LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bomb-proofing VISA serial interface

Hi

I am running labview 11.0.1f2 (32 bit) on a windows 7 PC, talking to a KMtronic USB relay device.I have problems when I am trying to communicate with Labview.

I have attached a snapshot of the program and the error.

 

Grateful if you could help. Thanks.

 

Bhimsen

0 Kudos
Message 11 of 17
(954 Views)

Hi bhimsen,

 

- which COM-Port are you trying to use?

- does your hardware even provide a COM port?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 17
(942 Views)

I don't have my development machine available today but will chack against my code as soon as I am able. Can you post a picture of the front panel so we can see the final string been written and COM port?

 

Thanks,

 

Mark.

 

P.S. GerdW, a functional KMtronic relay does provide a COM port (it runs a USB-Serial adaptor then the relay accepts instructions written to the "virtual" serial port)

0 Kudos
Message 13 of 17
(931 Views)

I have posted the picture of the front panel.The relay board does have USB port. I have tested it with its driver, it's working perfectly.

 

It is working in Labview in the single run mode. However, it is showing the error while on the 'run continuously' mode.

 

Thanks for your help.

 

Bhimsen

 

 

0 Kudos
Message 14 of 17
(922 Views)

Hi bhimsen,

 

never use "Run Continuously" except for debugging purposes!

 

- Use a while loop when you need your VI to run for some (unknown) period of time!

- Don't initialize the port in each iteration!

- Don't close the port in each iteration!

- Use some decent wait instead of banging the hardware as fast as you can!

 

- Go through some LabVIEW basics!

- Look at the supplied example VIs! I recommend "Advanced serial read and write" example VI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 17
(917 Views)

Thanks for your advice. I'll try and let you know.

 

Bhimsen

0 Kudos
Message 16 of 17
(908 Views)

Hi

It's working now.

 

Thank you for your help.

 

Bhimsen

 

 

0 Kudos
Message 17 of 17
(847 Views)