12-01-2007 06:22 PM
12-02-2007 03:46 PM
12-03-2007 11:12 AM
Hi Shimbloo,
You are going to have trouble synchronizing two visa sessions that have different baud rates. The VISA session with the high baud rate will execute faster than the other session, and receive data faster. Also, serial communication is event based, and by nature not deterministic. Because serial is not deterministic, using timing and synchronization does not guarantee that you will get your data when you expect. About the assert trigger, it may be that your devices do not support the *trg\n command.
This being said, Nitad is right, you should be able to use two synchronous timed loops to "synchronize" your VISA write and reads. Make sure that your timed loop gives enough time for both of your VISA sessions to finish execution before reiterating the loop. The issue with using timed loops is that you are relying on software timing and synchronization which does not offer good determinism/resolution. If milisecond resolution is sufficient for your application then software timing with serial communication will work for you.
Keep in mind, this solution will ensure that you make your write/read commands and receive your data during the same loop iteration, but will not synchronize when you make your command or receive your data within the loop interation. I hope this information helps.
Ted
12-05-2007 03:54 PM
Thank you both for the information, I did not even know that timed loop functions are avaiable in the new version.I used two timed loops within the main while loop, fortunately one of the devices had an optional baud rate at 9600 so I set both baud rates at 9600, but since one loop uses SLIP and the other rs-232 the result is not that great and still I get unsynchronized loops when the data rate increases, even within the range of 9600 baud. Tthis solution, using timed loop, seems to be satisfactory for now.
Thanks again,