Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA RS-485

I am trying to locate the syntax for using RS-485 with VISA. I am using a RS-232 to RS-485 converter. For example to access Com Port 1 the syntax is ASRL1::INSTR. What is the syntax for accessing a RS-485 device?
0 Kudos
Message 1 of 13
(8,711 Views)
Dime:

That will depend on how your RS232-RS485 converter plugs into the system and how you address it. If it connects to a RS232 port, such as COM1, then you will still use VISA to communicate via RS232 using ASRL1::INSTR.

A different example is a RS485 board that National Instruments sells that plugs into a PCI slot:
http://sine.ni.com/apps/we/nioc.vp?cid=1364〈=US

In this manner the RS485 ports appear as standard COM ports, such as COM5-COM8. Then you just use VISA to access ASRL5::INSTR, for example. The VISA calls are the same as for RS232. There are just some obvious differences, for example, you can't query the states of the DCD, DSR, or RI lines, because they don't exist. But viWrite and viRead work identically, just following the RS
485 protocol.

I hope this helps.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 2 of 13
(8,710 Views)
hello Dan,
i have an ADAM-4520 RS-232 to RS-485 converter and
i use this to communicate to several instruments.
i am using VB6 with NI-VISA and i dont know how to address each instrument because i need to send somewhere the address of the instrument.
can you help me with some syntax , pseudo-code or code example (not matter which lang.)
0 Kudos
Message 3 of 13
(8,712 Views)
Dan,
I have used the RS485/4 PCI card from NI recently. The ports of this card appear as COM ports.Can you share more information about how this can be done.

Regards,
Siddhartha
0 Kudos
Message 4 of 13
(8,711 Views)
Hi Noamco,
 
Sorry for chiming in on your old thread. I am also planning to use ADAM-4520 RS-232 to RS-485 converter
to be connected to different instruments {ADAM 4012 (AI) and ADAM-4150 (DIO)}. I am really new with the
RS-485 and the addressing. Any advise or sample code i would really appreciate.
 
Regards,

 
0 Kudos
Message 5 of 13
(8,386 Views)
Hi,

For help with getting started in Serial communication, check out this tutorial and this Serial starting point.  For specific commands or syntax, you may need to contact your device manufacturer.

Hope this helps!

Adam W
Applications Engineering
National Instruments

0 Kudos
Message 6 of 13
(8,371 Views)
Hi Adam,
 
Thank you for your reply.
Now I realized that LV serial protocol (COM port, baudrate, data bits, parity, etc..) is the same with RS232 and RS485. I am a little aware with RS232 since I am communicating with serial instruments like GPS Receiver and Magnet sensors.
In case of Advantech IO Modules (ADAM - AI and DIO) I will communicate to them via RS485. Is it really possible for me to make this driver and make assignment of each channels of the DIO ports?
Thanks for any advise. 
0 Kudos
Message 7 of 13
(8,350 Views)
Hi Bong,

As long as your device adheres to the RS485 protocol, then you should be fine to communicate with VISA and/or LabVIEW.  As for the specifics of making your driver and working with your devices DIO ports, you would need to check the device manual or contact the manufacturer for any commands or procedures to follow in that regard.

Hope this helps!

Adam W
Applications Engineering
National Instruments

0 Kudos
Message 8 of 13
(8,325 Views)

Hi Mr Adam,

Thanks for the reply and lots of idea. You are right. I just got the Users Manual and I can see lots of possible commands regarding the sensor.

 

Thanks again.

Bong

0 Kudos
Message 9 of 13
(8,316 Views)

Hi Mr Adam,

This is what i am trying to do. Kindly see the attached. I got this sample VI from the maker. I actually got a separate VI for each AI and DI. Since the two instrument are connected on the same RS485 port, I am planning to combine them in one VI (one While Loop). But i have few questions that i am not sure of the answer;

1. Is it really okay to combine them ?

2. How will I programatically designate address, channels, for each of them so LabVIEW can read the data?

Any advise I would greatly appreciate. Thanks a lot.

0 Kudos
Message 10 of 13
(8,309 Views)