FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

cFP-2120 help with RS232 ports

Hi I've been searching the forum, the tutorial and example sections, the cFP 2120 manual and the LabVIEW Help in the program itself and unless I have overlooked it I can't find info on where to get started to establish communication between the FP controller and a 3rd party device via RS232. I've read that this is not something that is established through MAX. So as I understand it this is strictly done through the LabVIEW program itself. I'm just having a difficult time figuring out where to start. To sum up what I'm trying to do in case I made it difficult to understand, I want to control a device that has an RS232 port with the cFP controller through its RS232 port.
 
I appreciate any helpful info I can get on this.
0 Kudos
Message 1 of 6
(3,979 Views)
TychoBrahe1911,

The easiest way to do this is the exact same way you would through LabVIEW on your host machine - with NI VISA. I would program the application on the host PC, or the serial part at least, to work with your 232 device. Once you get this working, all you need to do is change the VISA resource to correspond with the serial port on your FieldPoint. Once you deploy this, it should communcate with the device in the exact same way as the host machine.

Hope this helps,

Message Edited by Ryan V[DE] on 07-17-2006 03:36 PM

Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 6
(3,960 Views)

Thanks Ryan

That helps clear up much of my confusion. When you say "Once you get this working, all you need to do is change the VISA resource to correspond with the serial port on your FieldPoint." that is literally all that I need to do is just change the resource? From what I've read I had the impression that I needed to target the Field Point controller with Real Time in order to do any serial communication between it and whatever you have communicating with it but this is incorrect?

I am also not sure what type of VISA resource name to use. The host computer is communicating to the FP module through an IP address. From the list below I've been trying to use the Serial INSTR interface protocol but either I am entering it incorrectly or this is not the one to use. Using the VISA find resource VI all I find are the host computers serial ports.

Well I'm going to keep trying but if you have any more input to my new questions I'd greatly appreciate it.

 

Interface Syntax
VXI INSTR VXI[board]::VXI logical address[::INSTR]
VXI MEMACC VXI[board]::MEMACC
VXI BACKPLANE VXI[board][::VXI logical address]::BACKPLANE
VXI SERVANT VXI[board]::SERVANT
GPIB-VXI INSTR GPIB-VXI[board]::VXI logical address[::INSTR]
GPIB-VXI MEMACC GPIB-VXI[board]::MEMACC
GPIB-VXI BACKPLANE GPIB-VXI[board][::VXI logical address]::BACKPLANE
GPIB INSTR GPIB[board]::primary address[::GPIB secondary address][::INSTR]
GPIB INTFC GPIB[board]::INTFC
GPIB SERVANT GPIB[board]::SERVANT
PXI INSTR PXI[bus]::device[::function][::INSTR]
PXI INSTR PXI[interface]::[bus-]device[.function][::INSTR]
PXI MEMACC PXI[interface]::MEMACC
Serial INSTR ASRL[board][::INSTR]
TCPIP INSTR TCPIP[board]::host address[::LAN device name][::INSTR]
TCPIP SOCKET TCPIP[board]::host address::port::SOCKET
USB INSTR USB[board]::manufacturer ID::model code::serial number[::USB interface number][::INSTR]
USB RAW USB[board]::manufacturer ID::model code::serial number[::USB interface number]::RAW

 

0 Kudos
Message 3 of 6
(3,945 Views)
Maybe you've already seen this post.  If not it's worth looking at.  I'm going through the exact same thing as you and found it pretty helpful!  Also I just posted a question about the given VI here.
 
Good luck.
 
Hosehead.
0 Kudos
Message 4 of 6
(3,938 Views)
tycho - I was re-reading your post.  It seems you're at the beginning.  I don't agree with Ryan's post.  Everything else I've seen points to what you said, you need to have an embedded VI running on the cFP in order to communicate to a device on the cFP's serial port.  See this link, see where Aaron G. says, "It is not possible to access the cFP-20xx's serial ports except when running LabVIEW code in the cFP controller itself." I think that's pretty clear!

So you need 2 Labview VI's - one running on your PC and the other "embedded" on the cFP.  There's a bunch of different communications methods between the two, the easiest to me seems to be datasocket.  There's others too though.  For an example using datasocket, check out the examples in LV "Publish LabView Items (Server)" and "Publish LabView Items (Client)" for a general communications scheme between the two VI's, in addition to the example I mentioned in my previous post.  I'm working with this method, I figure although it might have some drawbacks it's probably going to be the easiest and fastest to implement without learning a ton of new stuff.

Once you've figured out the communications, then it's a matter of writing the embedded VI to read from the serial port.  You can do this using the VISA functions.  The example VI "Basic Serial Read and Write" is good for this.  If you just tweak this to "publish" the data instead of read or write to the front panel, it should be good for your embedded VI.

Again, the example mentioned in my previous post kind of does this already.  Then it's just up to you to write the PC's VI.  Apparantly you can do it like the "Publish LabView Items (Server)" example which reads from a Fieldpoint IO Point constant, or you can use a Datasocket Read.vi or Datasocket Write.vi.  I'm not sure if there's a difference, I've seen both in examples.

Hope this makes sense.  Hopefully I can post my own example up here soon of how I'm doing this, one for the embedded VI and one for the PC VI.

Oh yeah, one other interesting related link - an embedded VI (cfp_serial_test_comp_conversion.vi) that you can use to test how your serial port is running, seems kind of cool although I haven't had a chance to try it yet.

Hosehead

0 Kudos
Message 5 of 6
(3,932 Views)
All,

My apologies. After tycho's first post, I was assuming he was using RT on the FieldPoint and did not know how to access the serial port. From the embedded code's perspective, it is only a matter of specifying the correct serial port. If you want to then get this data back to another application running on the host PC, then you will have to program this communication link yourself. Shared Variables make this extremely easy, but as hosehead said, DataSockets are also an option. Good luck, tycho, and let us know if you have any other questions.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 6 of 6
(3,920 Views)