FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Bind shared variable to multi-channel item

How do i bind a shared variable (array) to a Fieldpoint multi-channel item?
When i configure the shared variable, and click browse to select the network item to bind to, i can select individual channels but there's no "All" tag.
0 Kudos
Message 1 of 7
(5,147 Views)

Actually I suspect that the problem is in the National Instruments OPC Server.

DataSocket can read array data types from an OPC Server, but National Instruments' OPC Servers do not publish data in an array format.

Probably the easiest solution is to publish your shared variable in your network but don’t bind it trough the opc server, instead you have to use it like a standard global variable (bind to source method).

 

Give a look to this document may lead you to a better solution.

 

http://digital.ni.com/public.nsf/websearch/FA610367EC62574186257118005089F2?OpenDocument

 

Hope these two tips can help you

FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
0 Kudos
Message 2 of 7
(5,126 Views)
Thank you, the document is very useful.
Actually i wasn't using the OPC Server, i didn't even know how to. I was binding to source directly, but that does not seem to allow multi-channel items, only individual channels appear in the browse tree, as IP\FP\Nmodule\Nchannel.
OPC instead allows to select item by their names as they were configured in MAX, including "All" item. Are you sure it is not published as an array? I had to stop testing cause i'm having other problems with OPC, i think i'll have to create another topic 😞
0 Kudos
Message 3 of 7
(5,123 Views)
I think there has been a misunderstanding, and reading my first reply I have to admit that this is only my fault. 
I used the word "bind" in a misleading manner, I must apologize for that.
I hope I'm going to hit the target this time. 
I think that what you are looking for is as simple as drag and drop.  The problem is to drag the correct item in the correct frame.   
I’m attaching a simple project that I hope will clarify what I’m saying.
 Step by step you have to 
1) Start a new project.
2) Add to the new project a real time target from the existing ones list, to see the target first ensure through MAX that communication with the FieldPoint is ok. 
3) Add a new shared variable to your project, for instance an array of double for thermocouples reading is ok 
4) Add a new Vi to your real time target. And drag and drop in this Vi both the shared variable and the all tag you can find in the project explorer below the CFp TC. 
5) Build a Vi suitable for reading the shared variable. 
6) Run The Vi in the cFp 
7) Run The Vi in the host PC.   
 
 In the example you can find steps from 1 to 5, you have to adapt the project to your actual configuration and do step 6 & 7.   
 
Write if you need further help.
 
Kind Regards
 
 
FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
Download All
0 Kudos
Message 4 of 7
(5,084 Views)

Thanks for your time, but i'm afraid there's another misunderstanding Smiley Tongue

I'm not working on RT. My Fieldpoint is not even an "intelligent" one, i only have VIs running on the host PC. And even on the PC, i don't want to read FP manually with "FP Read.vi", that is not "binding"!

Now i got my OPC-FieldPoint server to work properly; it does show multichannel items (with "All" tag) in its I/O Items tree. But they actually seem to contain only the first channel. If i bind a Double shared var to a multi item, it reads channel 0; if i bind an Array of Double shared var, it stays an empty array. Even Server Explorer 2.4.1 shows such items as one Double, and there is no array option as Data Type.

So i think your first reply was correct, NI OPC servers can't publish array data, unless there is some trick i don't know...

0 Kudos
Message 5 of 7
(5,078 Views)
Maybe you can find this document useful.
It is about my first reply.
 
 
Hope this can help.
 
Best Regards
 
 
 
FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
0 Kudos
Message 6 of 7
(5,055 Views)

Yes, it confirms again the most important concept:

National Instruments' OPC Servers do not publish data in an array format.

I wonder why the server's I/O items list shows "All" channels too...

0 Kudos
Message 7 of 7
(5,048 Views)