07-16-2009 12:25 PM
Hi,
I've made a struct with BOOL and INT TYPE inside on Twincat PLC. Now I am trying to write these global variables (reading works well)
and I cannot write INT (in LabVIEW I am using 16bit integer, besides writing boolean type works without problems). I do not use these
variables in PLC source code, I thought that it would be enough to change lenght of variable. I still do not know what does it mean hVar
in invoke node for writing, maybe there is my problem.
Thanks in advance for all answers
Karol
07-21-2009 07:29 AM
Hi
The "hvar" is simply the handle to a variable. In your example you invoke "AdsCreateVarHandle" for the boolean variable ("flag"). Here you get the handle (hvar) to your boolean variable, which is ok. The problem is that you try to use the same variable handle to a different variable - integer type. This is why I suppose your problem comes from. You need to invoke "AdsCreateVaHandle" once again, this time for integer variable, wire the correct hvar to the invoke node when you write it, and it should work fine.
Let us know if it helps.
Best regards
04-04-2010 01:06 PM
hi,
I'm facing with kinda same problem. but mine is bigger. I can't reach any of variables and my plc.I am using a beckhoff touch panel. In my VI Property nodes work well(i can get server status,id,port) so i think i connect to Plc however any kind of invoke nodes don't work and give error named (-2146826489)(Exception occured in AdsOcx Control: ADS ERROR: device is not in a ready state in Sample1) i just set up your vi but gaves same error. what i am doing wrong.
04-15-2010 09:42 AM
You may be interested to ask TwinCAT related questions at the LinkedIn TwinCAT Developers Group: http://www.linkedin.com/groups?gid=1860933