From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Device not allowing CTRL K and serial data delay

Hi

Im relatively new at programming in LV so please bear with me.
I have a temperature probe that needs to be calibrated every time (ideally) we use it. This requires communication over COM1. To calibrate the device it requires a command
CT=37 where CR is carriage return and LF is line feed and the calibrated temperature is 37C
Then after that CTRL+K has to be pressed to finish the calibration process. I tried coding this but it doesnt seem to work. I think it is because LV doesnt go about making the CTRL+K in the end. Can someone help me.

The other buttons code for different things, but everytime i press it the data that is stripped from COM1 is sometimes only bits and pieces of the entire string that the device puts out. Is there any way I can make sure that I am getting all the data or a way to wait till I can guarantee that the entire string output by the device is captured. Ill illustrate with an examnple.

String the temperature probe should put out
1: 27.42C
but i get sometimes chunks of this like
7.42C
Id appreciate it if someone could help me out with this.
Thanks
0 Kudos
Message 1 of 4
(3,110 Views)
Hi Shah,

You might check out this KB that explains the different reasons you could be receiving only parts of the data at a time. You might also check out the Serial examples that ship with LabVIEW. You can find them by opening LabVIEW>>Help>>Find Examples, this will launch the NI Example Finder. You can go to the search tab and type "Serial", this will bring up some serial examples that might be of some help.

What do you want your LabVIEW program to do when you press ctrl+k?

JenK
0 Kudos
Message 2 of 4
(3,093 Views)
Thanks Jen for your help. I dont want to press CTRL K , but CTRL K is what I want labview to send to my device to terminate the calibration sequence. Ive put the HEX equivalent of CTRL+K which is 0B but that doesnt seem to work. Dont know why? Can someone help please
0 Kudos
Message 3 of 4
(3,081 Views)
In the code you posted, in the Build Text where you're attempting to send CTL+K, you have /0b and not /0B (note difference between lower and upper case). When I paste /0b into a string control with '/' Cddes turned on, it displays as /00b. Try changing to upper case B and see if that makes a difference.
0 Kudos
Message 4 of 4
(3,078 Views)