08-14-2008 09:37 AM - edited 08-14-2008 09:38 AM
Here's an answer to a question that others might find useful:
The RS485 on the PACs (cFP-2220 e.g.) is 4-wire, however it is possible to use it in 2-wire mode. That information is available in the manual and here on this site, however some of the details you need to know to get it working are not (the manual does not even say that you need to put a jumper between Rx+ and Tx+ and Rx- and Tx-):
The detail I had to dig the most to find was the fact that you have to set a VISA serial property named wire mode...If you use the serial init VI or have your own that's a good place to expand the VISA resource property node used to set up the port and select serial-> wire mode. Set the mode to 2-wire auto and you are up and running.
According to the manual you will have to take into account that you will see the echo of the data you transmit, however with the wire mode set correctly that does not happen.
Just like all other 2-wire equipment there is always the risk of replies not coming through because the switch to receive mode is slower than the response time, however for me that has not yet been a problem.
12-09-2008 12:23 PM
Mads,
This is true for the cFP-21xx family as well. Although NI support always said that this was not a supported mode of operation but would not give any specifics. My testing showed the same problem with the time to switch from TX to RX mode.
03-11-2009 06:03 PM
Hi All,
How do I add the 2 wire mode into MB Init vi? I am new to labview and the serial port to the init vi only alow me to set I/O ASRL1 - 4. I need to make this a 2-wire mode. I am using cFP2220, com4 RS485 Modbus communication.
Thanks,
Bruce
03-11-2009 08:57 PM
There are no settings for 2-wire to 4-wire on any VI. There is nothing you can do in software, it is all in how you wire it up.
I don't know what success you'll have in trying to make the the cFP controller work in 2-wire mode. I would recommend using an isolator where you set it for 4-wire on the cFP side and 2-wire on the device side. I've used this one successfully. http://www.bb-elec.com/bb-elec/literature/485OPDR_2507ds.pdf
03-12-2009 04:30 AM - edited 03-12-2009 04:33 AM
I do not have access to LabVIEW here and now, but you need to find where the serial port is initialized (I guess if you look in the MB Init code you'll find it there), expand the VISA property node and select the wire mode property. Right-click on it to create a constant (enum) and select two-wire in the enum.
I can have a look at the MB VIs later and give you a picture of where to do it.
03-12-2009 04:32 AM - edited 03-12-2009 04:37 AM
Why do you say that Ravens Fan? It is perfectly possible to set it to two-wire in software (the VISA wire mode property), and it works like a charm. You need to put a jumper between two and two pins on the port, but that is not enough, if you set the VISA property as well though you get 2 wire.
I guess (not having looked at MB Init yet) you might mean that MB Init does not allow you access to its code...but that would not be a problem, you can still set the VISA property somewhere else.
03-12-2009 07:41 AM
__________________________________________________________________________
Mads said: "it works like a charm"
___________________________________________________________________________
There needs to be a very large asterisk with that statement. Using cFP in 2-wire mode should work well with large
enough delays between the Master sending the command and the Slave responding. Some instruments allow you to configure
the response time, some don't. Most instruments I have tested respond too quickly. This results in bus contention and loss of data.
The response time of the slave should be tested and verified using an o-scope.
03-12-2009 08:03 AM
03-12-2009 08:41 AM
Mads wrote:Why do you say that Ravens Fan? It is perfectly possible to set it to two-wire in software (the VISA wire mode property), and it works like a charm. You need to put a jumper between two and two pins on the port, but that is not enough, if you set the VISA property as well though you get 2 wire.
I guess (not having looked at MB Init yet) you might mean that MB Init does not allow you access to its code...but that would not be a problem, you can still set the VISA property somewhere else.
Can you show me a screen shot of that property node? I have never seen that one before.
03-12-2009 10:31 AM
As soon as I expanded the MB Serial Init vi ----> Property node (Instr) down to Serial Settings: Wire Mode and added RS485/Wire2-Auto, my "run" arrow is broken. How do I unexpand the unused property nodes to be able to run. Sorry, I am new to the labview syntax.
Thanks,
B-man