Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to automatically send command to serial port

Hi! All.  May I ask that how to automatically send a series of ASCII command in a defined time step to serial port? For example, if I hope to send ?0000, ?0001, ?0003, ?0005 and ?0007 in every 500ms to serial port COM1. Thanks.
0 Kudos
Message 1 of 3
(3,559 Views)
Attached you'll find a code fragment as example. Configure your serial port as required. Read responses etc.
The example just uses a for loop to send one string out of an array of strings to the specified port. Inside the loop, there's a wait_until_next_multiple_ms node, which ensures the regular sendings (with respect to the OS's possibilities, of course).

Greetings from Germany!<br>-- <br>Uwe
Message 2 of 3
(3,553 Views)
It works!  Thanks so much!
0 Kudos
Message 3 of 3
(3,547 Views)