LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

opto22 opc

Solved!
Go to solution

I am using Labview 2014 to communicate to an Opto22 rack and I'm having a problem with the SNAP-IDC5Q that is set up as a quadrature counter. I am using datasocket bindings to communicate with the points (no DSC module, don't want it).

I can read the counter and read/write to all my other I/O points (digital and analog) just fine, but I cannot use the COUNTERDATA_READCLEAR variable to reset the counter. Opto22 says it's my problem because the client needs to be set up for asynchronous data (?). This variable is not "scanned" in the Opto22 OPC server so you have to do a direct read to use it, which I am.

 

I read the variable bound to COUNTERDATA until a button is pressed and then I read the COUNTERDATA_READCLEAR variable.

 

I'm not sure what else to try! Of course the sample OPC client they provide works flawlessly...

 

Any hints?

 

Thanks in advance. Last problem on this project.

0 Kudos
Message 1 of 5
(3,248 Views)

Hey teritask,

 

What is the behavior you're getting whenever you read the COUNTERDATA_READCLEAR tag? Does it give you an error, or does it just not clear the counter? If it's the second option, does it read the counter one last time and then not clear, or does it not even read the last counter value?

 

 

Ty Prather
Technical Marketing Specialist
National Instruments
0 Kudos
Message 2 of 5
(3,187 Views)

No error and the datasocket LED is green. It does nothing...stays at zero (I read it into another variable) and the counter remains at the same count.

0 Kudos
Message 3 of 5
(3,173 Views)
Solution
Accepted by topic author teritask

Opto22 came back and told me that I have to read directly from the counter, not through a cache. Upon researching that in the forum I found this thread:

 

http://forums.ni.com/t5/LabVIEW/DataSocket-Read-from-OPC-cache-or-from-PLC/m-p/1797244/highlight/tru...

 

the gist of it being:  

the Data Socket Read VI can read only from the OPC server there is no way to read the PLC directly using Data Socket, the OPC server has to be used as a mid point between both clients ( LabVIEW and the PLC)

 

So, I have libraries that I started with from ArchonWest that I'm going to try to read it with. I started with those libraries but decided that spending the $300 for the OPC Server because data binding is much easier! Silly me...

 

0 Kudos
Message 4 of 5
(3,161 Views)

Hey teritask,

 

That makes sense! I'm glad that you were able to get that sorted out and have some direction on how to acomplish it!

Ty Prather
Technical Marketing Specialist
National Instruments
0 Kudos
Message 5 of 5
(3,120 Views)