Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA RS-485

Hi Bong

I'm not Adam but this is a public forum and some advise is needed.

First
If your devices are on the same rs485 cable, do both work when used alone?
You are now opening two serial resources and that only is ok when both are on a different interface.

My guess is that they are on the same cable and use the same resource .
The real difference is in the address in the beginning of the command.
Probably #01and $03

If so you can best combine them by creating a subvi from the writestring to port and read string from port
adding the special translation for the receive.
You then can call these after each other because calling them in parallel makes it impossible to determine which returned data should go to which read.

Furthermore your software looks good for a beginner but try to have as little corners in wires as possible making it even more readable.
And use the normal wait ms function instead of the wait until next ms multiple. You wont get hardware timing anyway and tryin to do all actions at the same multiple is not very efficient for a system. I know it is in all NI examples but that simply is a bad habit in Austin.

greetings from the Netherlands
0 Kudos
Message 11 of 13
(1,770 Views)
Thanks for the tips, Albert!  It is definitely good advice.

Adam W
Applications Engineering
National Instruments

0 Kudos
Message 12 of 13
(1,756 Views)

Hi Albert,

Thanks for the reply and advise.

I am planning that the two device (AI and DIO) will be connected in one network (same cable and resource). On the otherhand I also have the option of connecting them separately meaning different resource since i have a vacant port. But at this time i really do not know which is better. 

You said,

"You then can call these after each other because calling them in parallel makes it impossible to determine which returned data should go to which read."

I need to get data from the two device simultaneously (analog data from one instrument and digital data from another sensor). The system is unmanned and continuous data i want to get. So its like there will be a predefined syntax for each of the device. If you are saying it is impossible to know which returned data then it will be better to connect them at different resource, right?

It is my first time to make a software driver for analog and digital IO modules. I would appreciate if you can lead me to examples.

Thanks a lot. 

0 Kudos
Message 13 of 13
(1,746 Views)