LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Querying data via serial port while controling via serial

Hello,
 
What I am trying to do is to query data from a controller via an RS-232 cable while at the same time modify a position function on the controller via the same RS-232 cable.  I am not sure if this is possible.
 
How I invision the program working is such:
 
Under the "Wave Form" tab I can set the amplitude and frequency for a sine wave and initiate the waveform with the "Start Waveform" button and under the "Number of Cycles" tab I can set the while loop into motion by turning the "count on" to on in order to query the controller every 500 ms to give the number of cycles.  While I am querying the controller every 500 ms for the number of cycles I would also like to modify the sine wave by adjusting the amplitude and frequency and subsequently initiating with the "Start Waveform" button since the user-defined program on the controller will allow me to modify the waveform on the fly.
 
Will I be able to communicate over the RS-232 line this way with multple signals trying to get passed back and forth on the same line?
 
Thank you for any help, Mark
    
 
 
0 Kudos
Message 1 of 2
(2,311 Views)

You cannot continuously do one query and do another in parallel. Communication to an instrument is serial in nature. If you issue a command to read, you must then do a read and pause before a different part of your program can do a write.

Looking at your program, you have a mjor flaw anyway. Once you start the while loop with the Count command (from the "Number of Cycles' tab, you can't stop the while loop without terminating the entire program. You have the conditional terminal wired to a control outside the while loop and the status of the Boolean cannot be read.

0 Kudos
Message 2 of 2
(2,294 Views)