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.


Topics - mpfs

Pages: [1]
1
Hello,

I wrote a small test program to test the functionality of ReadRaw amongst other things.

There are certain instances where attempting a ReadRaw would throw an exception with the text "ReadRaw Error. Privilege Violation". Such an error occurs when attempting to read tags with names "GroupTest" and "AxisTest".

However, if I read individual elements within these structures, such as "Axis_Test.AxisFault" or "Axis_Test.JogStatus" using the Read method, I am able to read the data without issue.

Can someone explain to me why "Priviledge Violation" appears when I attempt to read the entire contents of the structure? Also, is there some kind of attribute or property which I can access to prevent such an action (so I don't have to catch these exceptions)?

Thank you!

2
Hello,

with the introduction of WriteRaw / WriteUDT I can seamlessly write data to a UDT. So far so good.  ;)
The only drawback of this is that I need to know how the UDT is structured, that is to say, what kind of elements make up my UDT (REAL, BOOL, and so forth).

Is there a method or a possibility to determine - from a UDT tag - how it is structured? This way I would not have to create a structure in my program and maintain it if the UDT's structure should change. If there is no such method, I think this would be a very useful, as it would provide flexibility.

Thanks!

3
Support Questions / Unable to read arrays (ClxDriver 1.2.1.0)
« on: February 15, 2018, 02:29:27 AM »
Hello,

in ClxDriver 1.1.5.0 I had success reading arrays by accessing their individual elements. As an example, I have a UDT containing a 3 element REAL array (MyUserDataTag1.RealArray). I was able to read the array as follows:

Code: [Select]
for (int index = 0; index < 3; index++)
{
string arrayElementTagName= string.Format("MyUserDataTag1.RealArray[{0}]", index);
Console.WriteLine("{0} read returned = {1}", arrayElementTagName, clxClient.Read(arrayElementTagName));
}

The code returned the contents of the array as expected.

Now, if I run this code using ClxDriver 1.2.1.0, I get a "KeyNotFoundException":
Code: [Select]
Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at ClxDriver.EthernetIPforCLX.BeginRead(String startAddress, Int32 numberOfElements)
   at ClxDriver.EthernetIPforCLX.Read(String startAddress, Int32 numberOfElements)
   at ClxDriver.EthernetIPforCLX.Read(String startAddress)
   at RockwellTest.Program.Main(String[] args) in [redacted]:line 88

This critical issue required us to rollback to version 1.1.5.0 - consequently removing the ReadRaw functionality which version 1.2.1.0 has provided.

When can an update be expected? Thank you!

4
Support Questions / WriteRaw has no effect (ClxDriver 1.2.1.0)
« on: February 09, 2018, 03:41:21 AM »
Hello,

I am using the WriteRaw method to write to a UDT in one go. The UDT consists of a single element of type REAL.
The WriteRaw method does not throw an error, but to check to see if the value was actually written, I call ReadRaw immediately afterwards; however, ReadRaw always returns the former value - as if WriteRaw was completely ignored.

I have tried the following, but to no avail:
- Switch the controller to PROG mode (it's in MEM mode by default).
- Wait 10ms to 10s before calling ReadRaw

Here is the partial code I am using to write to the UDT:

Code: [Select]
byte[] newValue = BitConverter.GetBytes(100.0f);
clxClient.WriteRaw(tag.TagName, 0, newValue);

I have also noticed that passing anything other than 0 in the second parameter ("numberOfElements") in WriteRaw throws an exception. Is it safe to assume that this is the offset of the byte array (the third parameter)?

Many thanks!

Pages: [1]