LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read an array with OPC and Datasocket?

Hi everyone!
 
I use the OPC server from Applicom. I can read an array of boolean, read and write a double but I can't write an array of double with the DataSocket.
 
What I do to write an array of double with the datasocket is:
 
-Right click on the array of numeric control ->Properties
-Data Binding
-Data Binding selection -> DataSocket
-Mode -> Write
-And I write a valid DataSocket URL
 
I don't understand why I can read an array but I can't write it?! I do the same thing for both and I just change de mode (if i want to read or write).
If I change the values in the array, I don't see the changes in the OPC Client, it's always 0.
 
I am doing something wrong? Any example?
 
 
Thank you very much,
Stephanie
0 Kudos
Message 1 of 15
(6,284 Views)

Do you have the DSC tag engine?? If so, you can read an array of register values with a single string tag if none of the registers contain a zero.

http://forums.ni.com/ni/board/message?board.id=170&message.id=122082#M122082

0 Kudos
Message 2 of 15
(6,262 Views)
Hi unclebump!
 
No I don't have de DSC board...
 
 
Please help me Smiley Happy
 
Thank you
Stephanie
0 Kudos
Message 3 of 15
(6,255 Views)

Hi Stephanie,

I'm not positive at this point why you are unable to write an array using datasocket, but I have a few ideas:

First of all, make sure that you initialize the elements of your array.  Second, what is the representation of the double that you are trying to write?  I have heard for example, that with some servers I8 will not work, but U8 will.

Try some different data representations and let us know if you have any luck.
Best Regards,
Megan B.
National Instruments

0 Kudos
Message 4 of 15
(6,227 Views)

Hi Megan,

Thank you for your answer. My array is initialize and I just tried to change the representation of it (I did all of them) and it's still doesn't work. I really don't understand why Smiley Sad

 

Any other ideas?

Thanx again,

Stephanie

0 Kudos
Message 5 of 15
(6,220 Views)

Peachy wrote:
... I use the OPC server from Applicom. I can read an array of boolean, read and write a double but I can't write an array of double with the DataSocket.
...
I don't understand why I can read an array but I can't write it?! I do the same thing for both and I just change de mode (if i want to read or write).

Stephanie,
You don't explicitly state that you can write an array of "double"s.
Can you?

If you can read an array of doubles but not write, you have a similar problem to what was described in this old thread.
Unfortunately, the thread doesn't have a clear solution to the problem.

Also, to avoid confusion, what do you mean by "double" … a 64 bit floating point number? … or a 32 bit double word/integer?  What device are you communicating with?
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 6 of 15
(6,210 Views)