I'm hoping that someone out there can assit me with a problem I'm having with some serial communications. I'm using the NI 9068 which has three built in serial ports. Port 1 and Port 2 are RS-232 and Port 3 is RS-485. When I bought it I thought all three ports were RS-232 as I have three devices that I need to communicate with to the cRIO. I have in the past had good luck using a B & B electronics RS-232 to RS-485 converter on the same chassis.
I'm trying to communicate with a scale, and I have created VI's that work to communicate with the scale when I use one of the two RS-232 ports. However I cannot communicate with the scale when I try to use the RS-485 port and the B&B converter (model number 4WSD9R). I will either get a warning saying that the number of bytes at the port is equal to that which was read (i.e. 0 bytes) or an error -1073807298 when it actually does read something (for example /0/00/0) but not what it is supposed to be reading.
I have tested the hardware and the wiring to the converer by connected the RS-485 port to the converter then the converter to a RS-232 port. I will then write to the 485 port and read from the 232 port. The data transfers from one port to the other just fine. I have also switched the configuration to write at the RS 232 port and read from the RS 485 port, and again the data transfer just fine.
To me it seems as though there is some issue with the Bidirectinal communications. In case this is the problem I have the Rx crossing over to the Tx lines on the RS 485 side. I'm pretty sure this is correct of the communication described above would not work at all.
Thanks for any help that can be offered
That is interesting, the code I'm running works fine to communicate to the scale when I use on of the RS-232 ports. I am using the VISA bytes at port and I do ignore the warning. but the data I get back is just gyberish when using the RS-485 port. Is there something I need to do different because I'm using the RS-485 port?
What sort of RS-485 to RS-232 converter are you using and are you using 2-wire or 4-wire RS485? The ones I've used before had to have specific settings and/or had a small microcontroller inside them to do line driver control. If you look on this page (http://www.kksystems.com/inline-interface-converters/non-isolated) you'll see different types of converters - some need RTS control if using RS485 and others have a microcontroller onboard for doing automatic driver control. Something to consider?
Sorry Dennis, What was your question, Yes i tried it on the 232 port then just chanaged the resource. Yes I tried using Hyperterminal before I programmed anything in LabVIEW. The ports are on a cRIO so I cannot use Max.
Sam, I'm using a B and B electronics converter model 4WSD9R there are some dip switches on it and I'm using it in 4-wire mode with echo off. I did a loop back test which worked fine. But if Dennis is correct then that actually doesn't mean anything and I could have something connected wrong.
What is the Scale? Is it supplying enogh power to power the converter? Did you try the external supply? Does the scale support hardware handshaking? Does it need hadrware handshaking? (the converter won't drive those lines since it uses them for power)
What is your Hyper Terminal configuration that worked on the 232 port?