Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

not able to write serial port

I need to read data(pressure) from DTG pressure gauge made by crystal engineering. I am not able to read correct data from device. i wrote proper command to write to serial port and device is communicating with my program but serial port not reading my command. i attached program ...help will be great.
0 Kudos
Message 1 of 2
(2,774 Views)
Your program has a problem in the outer while loop. There is no data flow between the "Serial Port write" and the inner while loop. You cannot say which will be executed first. Connect the "Error Code" from "Serial Port write" to the inner loop to force first to write and then to read.
Put a "Wait for next multiple ms" with a value of 2 ms into the inner loop to let the CPU do other work.
Which Os do you use? I have seen a WinME machine where we never got any byte from the serial port using the compability VIs as you. This was a customer machine it it was updated to WinNT before we could made any tests using VISA.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 2
(2,774 Views)