Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing serial aquisition with CTS / DTR signals

I am creatinga VI (my first) to read 4 bytes from the serial port and concatenate them into a 32 bit word. I have figured out how to do the concatenation etc. but am having difficulty figuring how to use a pulse on the CTS or DTR line to "frame" the 4 bytes. I am now familiar with the VISA resources and how to monitor the CTS / RTS etc. I am just having trouble with the process as follows.

1) wait for CTS pulse (from peripherial)
2) Then grab the four bytes
3) concatenate the fourbytes into a word
4) send word out to be used in a "waveform" format.

My hadware is an FPGA that is connected to an A/D. I have the FPGA send a pulse on the CTS line to the PC on the transmission of the first of 4 bytes.

Any
help or pointers are much appreciated.
0 Kudos
Message 1 of 4
(3,899 Views)
What is the purpose of the CTS pulse - are you trying to use the CTS pulse as hand shaking? Or are you simply saying "here comes 4 bytes". Is there other serial traffice that should be ignored when CTS is not asserted?
0 Kudos
Message 2 of 4
(3,899 Views)
The purpose of the CTS pulse is just to say here comes the start of a 4 byte chunk. There is no other traffic on this line. I am merely using it to keep everything in line. If you miss one byte for what ever reason everything goes to crap after that.
0 Kudos
Message 3 of 4
(3,899 Views)
Since you are only waiting for 4 bytes there are a couple of ways to do this. One way is to not use CTS and just perform VISA reads until you get 4 bytes. Or, you could use CTS and perform a VISA read of 4 bytes on a VISA (CTS) event.
0 Kudos
Message 4 of 4
(3,899 Views)