Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - spaderkung

Pages: [1]
1
' And this is my revision because
'  2^31 can not be cast as int32
'  last bit is sign bit giving a negative value for dint.31

d(i) = Convert.ToString(((Convert.ToInt32(Responses(SequenceNumber).Values(ElementNumber)) And Convert.ToInt32(1 << BitNumber)) <> 0))

I have run the following tests:
Code: [Select]
WritePLC Lx.DINT.31 1
WritePLC Lx.DINT.17 1
WritePLC Lx.DINT.0 1
WritePLC Lx.udt.DINT.31 1
WritePLC Lx.udt.DINT.17 1
WritePLC Lx.udt.DINT.0 1
WritePLC Lx.arrayudt.DINT.31 1
WritePLC Lx.arrayudt.DINT.17 1
WritePLC Lx.arrayudt.DINT.0 1
WritePLC Lx.INT.15 1
WritePLC Lx.Int.7 1
WritePLC Lx.Int.0 1
WritePLC Lx.udt.INT.15 1
WritePLC Lx.udt.Int.7 1
WritePLC Lx.udt.Int.0 1
Compare  = Lx.DINT.31 1
Compare  = Lx.DINT.17 1
Compare  = Lx.DINT.0 1
Compare  = Lx.udt.DINT.31 1
Compare  = Lx.udt.DINT.17 1
Compare  = Lx.udt.DINT.0 1
Compare  = Lx.udt.INT.15 1
Compare  = Lx.udt.Int.7 1
Compare  = Lx.udt.Int.0 1
Compare  = Lx.INT.15 1
Compare  = Lx.Int.7 1
Compare  = Lx.Int.0 1
Compare  = Lx.arrayudt.DINT.31 1
Compare  = Lx.arrayudt.DINT.17 1
Compare  = Lx.arrayudt.DINT.0 1
WritePLC Lx.DINT.31 0
WritePLC Lx.DINT.17 0
WritePLC Lx.DINT.0 0
WritePLC Lx.udt.DINT.31 0
WritePLC Lx.udt.DINT.17 0
WritePLC Lx.udt.DINT.0 0
WritePLC Lx.arrayudt.DINT.31 0
WritePLC Lx.arrayudt.DINT.17 0
WritePLC Lx.arrayudt.DINT.0 0
WritePLC Lx.INT.15 0
WritePLC Lx.Int.7 0
WritePLC Lx.Int.0 0
WritePLC Lx.udt.INT.15 0
WritePLC Lx.udt.Int.7 0
WritePLC Lx.udt.Int.0 0
Compare  = Lx.DINT.31 0
Compare  = Lx.DINT.17 0
Compare  = Lx.DINT.0 0
Compare  = Lx.udt.DINT.31 0
Compare  = Lx.udt.DINT.17 0
Compare  = Lx.udt.DINT.0 0
Compare  = Lx.udt.INT.15 0
Compare  = Lx.udt.Int.7 0
Compare  = Lx.udt.Int.0 0
Compare  = Lx.INT.15 0
Compare  = Lx.Int.7 0
Compare  = Lx.Int.0 0
Compare  = Lx.arrayudt.DINT.31 0
Compare  = Lx.arrayudt.DINT.17 0
Compare  = Lx.arrayudt.DINT.0 0

With this tag list
Code: [Select]
Tag PLC-adress
Lx.DINT.31 di0.31
Lx.DINT.17 di0.17
Lx.DINT.0 di0.0
Lx.INT.15 i0.15
Lx.Int.7 i0.7
Lx.Int.0 i0.0
Lx.udt.DINT.31 t.di0.31
Lx.udt.DINT.17 t.di0.17
Lx.udt.DINT.0 t.di0.0
Lx.udt.INT.15 t.i0.15
Lx.udt.Int.7 t.i0.7
Lx.udt.Int.0 t.i0.0
Lx.arrayudt.DINT.31 t.dia[0].31
Lx.arrayudt.DINT.17 t.dia[0].17
Lx.arrayudt.DINT.0 t.dia[0].0

2
Thanks,

Looks like it should work right (but some bit might give a negative value?); I will edit this reply after I run my test suite.

3
Same for INT, DINT.

For example: Read(IntegerTag.1) will return 0 or 2. I would expect 0 or 1.


AdvancedHMIDrivers.EthernetIPforCLXCom connectionAdvancedHMI;
connectionAdvancedHMI = new AdvancedHMIDrivers.EthernetIPforCLXCom();
... connecting and validating other read/write operations ...
connectionAdvancedHMI.Read("IntegerTag.1");

4
Many thanks, resolved

At least for the exception, it was AdvancedHMIControls.dll that was needed. So I hope it will work now, but I have no PLC until after the weekend.

I saw another thread in the bug section where it was reported that the dependencies had increased in the later versions... I can understand why as the focus of the project is a HMI platform. But this would be a cleaner and more configurable platform if the graphical interfaces which I believe are in the "Control" was separated from the IO-part contained in "Drivers".

And I saw that v 1.70 also had the GetTagInfo(), so I could have settled for that to solve my original question : )

The dll's needed are
AdvancedHMIControls  (for versions > 1.7 up to and including v 1.97, which was the most recent)
AdvancedHMIDrivers
MfgControl.AdvancedHMI.Drivers

5
Ok, thanks again.

The error is there for all above v3.70 as you said. But I do not understand why.

I do not have any namespace issues reported by VS and everything compiles ok. Although using my old project, I wrote a new test class and the only thing I did was to create an instance of it, but modify the IP-property throws exception.

My application does not contain any UI, only read/write operations. It only uses the drivers mentioned; not the ones for control. Could there be some build issues (version/architecture) changes made in 3.80 that are hidden from VS because the direct calls to some DLL?


6
Thanks,

I did not have that method in my version, and have upgrade to using BetaV397c, more specifically the drivers:
AdvancedHMIDrivers.dll
MfgControl.AdvancedHMI.Drivers.dll

I built the AdvancedHMI solution on my PC and has referenced the compiled drivers.

EDIT: This version seems to have affected my whole project. I cannot connect anymore.
AdvancedHMIDrivers.EthernetIPforCLXCom connection = new AdvancedHMIDrivers.EthernetIPforCLXCom();
connection.IPAddress = "...";

NullReferenceException on Line 115 in EthernetIPforCLXCom.vb.
And a MsgBox saying: Incomplete solution.


7
Hi all,

To make this work I have the following solution, that unfortunately does not work for INT.bit, only for DINT.bit. Is there a way to get the datatype from the driver read response? Then I can do it right.

The CIP message should as I understand it (1756-PM020A-EN-P, page 12) report the datatype, so it would be nice to be able to get that one too when calling AdvancedHMIDrivers.EthernetIPforCLXCom.Read().

This is my current solution, not usable for INT - only DINT.
1. Detect if the tag has a dot suffix - Tag.x
2. Read Tag as DINT and bit mask to desired value
3. Write tag as DINT


Pages: [1]