Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mhoneywill

Pages: 1 ... 7 8 [9] 10 11 12
121
MODBUS / Simple Modbus Simulator
« on: September 07, 2009, 05:22:54 PM »
Hi Mark,

I want to make a simple modbus simulator that will resond to all 247 modbus addresses, I want it to compute the response depending on what address is read. i.e. if the input register at address 1 is read I would like the data returned to be 1, if adress 2 is read the data should be 2 etc. This is for testing purposes.

I know I could use MODBUS_SHARED_SERIAL_INTERFACES but this seems like a bit of overkill. I thought I might be able to use fnMODBUSuserFunction but how do I get this to be called for every address?

Cheers

Martin

122
µTasker general / Re: IIC File system
« on: September 01, 2009, 05:33:01 PM »
Hi Mark,

Historically our boards have been layed out for an IIC memory chip rather than a SPI chip. On a new layout we may well include SPI memory chips.

We've used FRAM chips from Ramtron http://www.ramtron.com/products/nonvolatile-memory/serial.aspx they have unlimited writes and have an instant write time. As our configuration info is generally quite small these chips make for a good solution.

I'm thinking I may well modify the utasker IIC memory Driver to allow a pointer to be passed for memory read and write to avoid having to double buffer data.

Cheers

Martin

123
MODBUS / Re: MODBUS simulation/testing on PC
« on: September 01, 2009, 05:05:45 PM »
Hi Jez,

I'm one of the users of the Modbus module and I can fully use it in the simulator. I use various modbus applications to connected to my simulated device via both serial and Ethernet.

To connected to the device I have used a handy little tester from here
http://omniflow.com/Products/SoftwareDownloads/ModbusTester_install_v2.11.zip

I've also written some simple VB6 programs using this ActiveX control
http://www.modbustools.com/modbus_activex.asp

Note if you are writing your own VB6 programs, you might want to look at the comm32 OCX control, which improves on the standard MSCOMM32.OCX, one key feature is that it supports access to com ports higher than com16. see http://www.comm32.com/

When testing RTU and ASCII protocols on the PC I've been using Com0Com http://com0com.sourceforge.net/ to create virtual serial port pars with one port of the pair connected to my uTasker simulation and the other connected to this simulator http://www.plcsimulator.org

I've also used the terminal emulator Realterm http://realterm.sourceforge.net/ I'm using version V2.0.0.65 from here http://www.i2cchip.com/realterm/
Realterm has a bit of a clunky interface but the killer tool for me is that for a small donation you can get a spy driver that will allow you to spy on communications on a com port (Virtual or real).

Another powerful tool to monitor serial port comms can be found here http://www.serial-port-monitor.com/

Also to answer your question yes you could use the code in uTasker to build your own test masters and clients. But if there was a bug in the uTasker modbus code (heaven forbid ;-) ) you might not be exposing it.

Hope the above helps

Cheers

Martin Honeywill

124
µTasker general / Re: uTasker: strengths and weaknesses
« on: September 01, 2009, 10:36:27 AM »
I would second the Support comment, its Fantastic!!!. Mark is constantly developing the product range and has a very in depth knowledge of what makes uTasker Tick.

One of the very powerful featues of uTasker which it takes a while to get your head around is that its simulation environment based around compiling your code in Visual C is a very good way of working. I'm mostly now developing my application on the PC in visual C, using all the power of visual Studio to debug and develop the application. Once I have delevoped a section or module I will then compile to the Target (I use Rowley Crossworks for Arm) invariably the code works first time.

I use uTasker on the Luminary LM3Sxxxx chips, I also use the Modbus extension module which is very very comprehensive and powerful. 

The biggest difficulty I found was that the sample application does everything!! and its all controlled by #ifdef statements. This makes it difficult with a cursary glance to see whats going on. For a beginner trying to peal back the layers to show a simple UDP or TCP application this can be confusing. What this means is that you have to dedicate a few hours to understanding whats going on. (But the effort is worthwhile). I understand that the new version V1.4 may well have split up the examples into smaller "bite" sized chunks, but I've not had the chance to look at it in detail. 

Another area where uTasker improves over the likes of UIP and LWIP is in documentation, this again is very comprehensive and is every growing.

Feel free to ask further questions, as I believe uTasker deserves all the exposure it can get and I'm sure other developers like Aaron and myself would be happy to "Blow uTaskers trumpet".

Cheers

Martin

125
µTasker general / IIC File system
« on: August 29, 2009, 10:31:24 AM »
Hi Mark,

I'd like to know how easy it would be to create an IIC file system, similar to the SPI file system. In my prodduct I have an IIC FRAM chip (fast write times, unlimited writes), and I was thinking of accessing this memory using the uTasker file access commands. I've got the following questions

1. Can you give me some pointers as to which routines, need modifying.

2. The simulator would need modifing to save of the IIC memory on shutdown, and restore it on powerup

3. I have other IIC pheripherals on the same bus, and would still want to be able to support those.

4. It would be nice if the internal Flash, SPI and IIC memory areas were all avalable at the same time, I currently don't have SPI flash so thats not an issue at the moment.

5. In anticipation of supporting other types of non volatile memory like SD cards and USB memory devices, maybe the file access commands need to have an extra parameter that specified which "device / memory area" they are reading from.

Cheers

Martin

126
Hi,

I've done a bit of research and there is some interesting software drivers out there, so this may not be as far fetched as I first thought. It would be a good string to add to uTaskers already big Bow.

See http://en.wikipedia.org/wiki/COM_port_redirector#Freeware_solutions

http://www.eterlogic.com/Products.VSPE.html

I'll do some more investigation, the lantronix drivers look interesting, they seem to use this standard http://www.faqs.org/rfcs/rfc2217.html

Cheers

Martin

127
µTasker general / Using uTasker to create a serial to Ethernet conveter
« on: August 26, 2009, 06:28:23 PM »
Hi Mark,

We have an application where we are looking for a serial to Ethernet converter (Having a virtual serial port on a PC that links via Ethernet to a physical serial port on a target microprocessor). I know there are a number of simple modules out there by Lantronix and Xport that provide this functionality, but I was wondering if this was anything you had looked at with uTasker.

I can forsee the most dificult part would be getting software to create the Virtual Serial port on the PC. I've seen the Com0Com project which allows ypu to use com2tcp but this solution seems a bit long winded.

Cheers

Martin

128
Hi Mark,

I'd like your advice on how to handle the following scenario in uTasker.

I have a task TASK_COMMS_TX which formats a message packet which is then sent out of a serial port using fnWrite(SerialPortID......  as well as sending a packet out on the serial port it also Starts a time-out timer using  

    uTaskerMonoTimer(TASK_COMMS_TX, (DELAY_LIMIT)(0.25*SEC), E_COMMS_TIMEOUT);     // Set Timeout timer for 250ms

I have another task TASK_COMMS_RX which handles the serial reception from the remote device, this task parses the received message. If it receives a valid reply then I want TASK_COMMS_TX to process the next message that may be waiting in its Queue. The reception of a valid message should also stop the above time-out timer using
    
    uTaskerStopTimer(TASK_COMMS_TX);                                     // stop timeout timer

TASK_COMMS_TX is configured to be in the state UTASKER_STOP, so it should only be woken by events.

What I want to do is use the input queue of TASK_COMMS_TX to cache incoming messages, that will be processed either after a valid reply to a previous message is received or a time-out from a previously transmitted message occurs. Am I correct in saying that if TASK_COMMS_TX is in the state UTASKER_SUSPENDED nothing can wake it, where as if its in the state UTASKER_STOP. Any event will wake it including the reception of another packet to be transmitted.

One way around this would be to have another task, to handle the Time out event and switch TASK_COMMS_TX into the UTASKER_STOP state when a timeout occurs, but this seems a bit untidy, 3 Tasks to handle a comms protocol.

Is the above the way to do this or is there a simpler way?

I hope the above makes sense

Cheers

Martin Honeywill

129
Thanks Mark,

Using your pointer I added an extra external definition to WinSimMain.cpp as shown below.

    extern "C" unsigned int KeyBoardCode;

This meant I could remove the line

    extern unsigned int KeyBoardCode;

From application.h as it was no longer needed, because the only external reference to KeyBoardCode is in WinSimMain.cpp.

Now it works as I hopped, KeyBoardCode contains a code representing the last key pressed, which my application can use when it is running in the Simulator.  ;D

For others who might be reading this post see this link it provides a bit more info

http://msdn.microsoft.com/en-us/library/0603949d%28VS.80%29.aspx

Cheers

Martin


130
Hi,

I'm trying to use buttons on a PC Keyboard to simulate  buttons on my target device, making it easier to drive a user interface rather than clicking individual I/O pins with the mouse. I was planning to use the PC cursor keys to emulate a keypad, with other keys emulating an ok and esc button.

My thought was to add a variable KeyBoardCode into the WM_KEYDOWN event in WndProc() in WinSimMain.cpp, I could then examine this variable in my code to check for a keypress. I was planning to wrop this test so it was only compiled if running in simulation mode.

        case WM_KEYDOWN:
           KeyBoardCode = wParam;
           if (0x10 == wParam) {                                        // shift key down {11}
                iShiftPressed = 1;
            }
#ifdef SUPPORT_KEY_SCAN
            else if (VK_ESCAPE == wParam) {                              // ESC key pressed
                iInputChange = fnCheckKeypad(-1, -1, 0);
            }
#endif
            break;

I defined KeyBoardCode in application.c

    unsigned int KeyBoardCode;

And put an extern reference to it in application.h

    extern unsigned int KeyBoardCode;

When I compile this I get the error

    Error   1   error LNK2001: unresolved external symbol "unsigned int KeyBoardCode" (?KeyBoardCode@@3IA)   WinSimMain.obj   uTasker

Even though I know application.h is included via config.h in WinSimMain.cpp.

I'm not sure whats happening here, is it because I trying to include a variable defined in a C file in a C++ file?

Any help greatly appreciated

Cheers

Martin

131
Interesting,

I wonder how Atmel have integrated the EFSL FAT support for SD cards into uTasker, have you had a chance to look at this Mark?

Cheers

Martin

132
µTasker general / Re: Higher resolution Timers in uTasker simulator
« on: June 08, 2009, 01:55:50 PM »
Hi Mark,

I'm not familiar with windows calling conventions so am not quite sure how to declare a call to NtSetTimerResolution in WinMain, from reading around it seems that something like

    NtSetTimerResolution(10000, TRUE, &ulCurTimerRate);

Would set the tick rate to 1ms, (its specified in 100ns steps).

Can you give me some points on how to declare the API function above.

Cheers

Martin

133
µTasker general / Higher resolution Timers in uTasker simulator
« on: June 07, 2009, 01:49:54 PM »
Hi Mark,

I'm starting to use the utasker simulator to produce standalone simulators that are simulating other parts of my hardware. (Like Modbus slaves etc). This is allowing me to test other parts of my system. One limitiation I'm running into is that lask of support for hardware Timers in the windows simulator, my understanding is that hardware timers are mapped to the basic system tick which I have reduced to 10ms, in config.h

#define TICK_RESOLUTION      10

It seems that the basic windows Tick rate can be easily modified from its default 10ms to 1ms see http://technet.microsoft.com/en-gb/sysinternals/bb897569.aspx I was wondering how easy it would be to modify uTasker so that in its simulator it could support a higher resolution timers, thus approximating the real hardware more closely.

Cheers

Martin

134
Luminary Micro TM LM3SXXXX / Re: Problems trying to Read using IIC
« on: June 06, 2009, 01:47:50 AM »
Brilliant, that seems to have fixed it, Reads now work without a problem.

Also I'm pretty sure the problem with single byte reads has gone away too (a typo on my part with your previous fix).

So in conclusion. It looks like IIC is now working again with no known faults.

Thanks again for the fast response Mark.

Cheers

Martin

135
Luminary Micro TM LM3SXXXX / Re: Problems trying to Read using IIC
« on: June 05, 2009, 10:51:01 PM »
Hi Mark,

I'm only commanding several reads in the initialisation task for testing purposes, normally I wouldn't have any there. It was only to prove the point that single byte reads seemed to fail.

My I/O chips don't need a write beforehand as they only have two data registers.

Cheers

Martin


Pages: 1 ... 7 8 [9] 10 11 12