LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read/write to usb serial port

Hello,

I got an rs-485 cable that goes into usb converter. (a usb cable is in use)

 

I followed an NI guide about how to install the usb driver so that MAX will be able to recognize it. (http://www.ni.com/tutorial/4478/en/)

finally i got the usb port appearing on MAX, but i cant communicate with that port.

 

is there any vi to test the connection?

 

MAX photo and windows drivers manager attached.

Download All
0 Kudos
Message 1 of 8
(6,088 Views)

Hi udi,

 

is there any vi to test the connection?

Do you see the "Open VISA Test Panel" button in your MAX screenshots? Why not use it?

For serial communication you can use any tool similar to "HyperTerm" for testing purposes…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(6,083 Views)

i tried to use this option, but i cant read anything, and when im writing the simple commands (like *CLS\n) it just saying that the msg sent.

screenshots attached.

 

Download All
0 Kudos
Message 3 of 8
(6,072 Views)

Hi udi,

 

do other tools (like HyperTerm) work for you?

Does your device understand those "simple commands" like "*CLS\n"?

Do you use the termchar ("\n") as is expected by your device?

Which device are you using at all? What is connected to the other end of your USB-RS485 converter?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(6,067 Views)

the device is a radiation meter, it has it own set of commands, but when i try to send them i got errors.

those commands look something like this:

 

1 48 48 48 49 49 52 99 116  114 48 65 29 4

0 Kudos
Message 5 of 8
(6,041 Views)

Hi udi,

 

the device is a radiation meter

Which type? Which manufacturer? Can you provide a link to a manual for this device?

Without any hard specs we cannot offer substantial help!

 

those commands look something like this:

I doubt those commands look like your example!

I guess they rather look like "\01000114ctr0A\1D\04" when using a string in \-code display mode! (Or "0130 3030 3131 3463 7472 3041 1D04" in hex display mode…)

 

Your device will only answer when it receives a correct request - so you need to send correct requests/commands…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 8
(6,035 Views)

thanks for the reply.

i am able to send now the data to the device through the MAX .

 

now, where i can find a vi that do the same? (i tried the examples of USB - Bulk and all the others, and none of them sees the usb port at all.)

 

Thanks!

0 Kudos
Message 7 of 8
(6,021 Views)

Hi udi,

 

for serial ports (aka COM ports) you use the "Basic/Advanced Serial Read and Write" examples.

(Or any other similar VI found here in the forum as your questions comes up very often…)

 

You still don't name the device type/manufacturer. Did you try the IDNet?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(6,013 Views)