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
(5,577 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
(5,555 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
(5,548 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
(5,520 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
(5,513 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
(5,503 Views)
Hi Donald,
 
I'm sorry.. I'm French and I don't understand what do you mean by: "You don't explicitly state that you can write an array of "double"s."
I saw the other thread, I have the similar problem and the answers on the old thread didn't answer my question, that's why I wrote another thread.

To be sincere, it's the first time I program with LabVIEW and it's the first time I use an OPC server. Maybe that's why I'm a little bit confused and I need help.
 
I think I use 16 bit double word and I'm using Modbus communication with Windows "Direct Link".
 
Maybe my problem comes from the Console Applicom !? Well, if my only problem is to write an array and the others things work.... it necessarily comes from LabVIEW, no? This problem is so weird, I really don't understand and don't know what to do. I NEED to fix it...
 
I'll give you what I did, but it's almost nothing because it's only datasocketing a front panel item...
 
Thanx everyone for you time and answers, I really appreciate!
Stephanie
0 Kudos
Message 7 of 15
(5,495 Views)

Stephanie,

What version of labview are you using??

0 Kudos
Message 8 of 15
(5,493 Views)
Hi unclebump
 
I'm using Labview 8.0 Smiley Happy
 
Stephanie
0 Kudos
Message 9 of 15
(5,490 Views)
Is the applicom opc server program running on the same computer as labview?? Modbus is directly supported in labview 8. You may not need to use datasocket. Are you using an ethernet communication or serial?? You may be able to setup your opc server address as 127.0.0.1 and directly read the modbus info into labview.
0 Kudos
Message 10 of 15
(5,483 Views)