07-22-2005 07:56 AM
GerdW, thank you for recommendation!
I try to do it.
Bes regards, Mikhail.
08-04-2005 07:54 AM
08-04-2005 12:11 PM
08-05-2005 04:15 AM
08-05-2005 11:49 AM
08-08-2005 05:30 AM
10-02-2006 10:33 AM
Hello
interesting subject, I'm doing something similar.
Let's say there is a piece of equipment that transmits a small message i.e 'IM_ALIVE', 8 ASCII chars. Then it transmits data i.e ABCDABCDABCD (four bytes of ASCII) all the time
To syhcronise: 1) run VI waiting for 'IM_ALIVE' string. 2) start external equipment that transmits this. 3) after 8 byte string recognised, plot data A to graph 1, data B to graph 2 etc... (decimate these 4 bytes).
Problem: need to receive 8 bytes for first part, then change to 4 bytes for ABCD data. (without missing anything in between) i.e total message: IM_ALIVEABCDABCDABCDABCD..........
Any ideas out there?
Cheers in advance
Aid
10-02-2006 10:46 AM
10-03-2006 06:49 AM
Hi
Had a go at that idea.
I want main stop button to stop everything, then when ran again back to waiting for start string. see attached
By resetting the external equipment, I can monitor the recieved string value, it only gets the full 'IM_ALIVE' now and again, not every time! even if it gets all the string, it doesn't break out of the first while loop, hence nothing plotted.
Is this as your spec, or have I missed something?
Thanks for help though
Aid
10-03-2006 11:42 AM - edited 10-03-2006 11:42 AM
You are not using the Visa Serial Bytes at Port function. It is located in the same palette as the Serial Read and Write functions. It will return the number of bytes waiting to be read at the serial port. Just put it in a loop to wait for 8 bytes, then break out of the loop. This ensures that you will read all 8 bytes. See picture below for an example. The NumBytes should be set to the number of bytes you are waiting for (4 or 8 in your case). Timeout is the number of tenths of a second to wait before exiting the loop. This is so you don't get stuck in an endless loop if the serial port breaks or the external device does not transmit. You should add code to check if a timeout occured before trying to read (use a case structure).

Message Edited by tbob on 10-03-2006 10:43 AM