You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to read integer types (INT, DINT, LINT) as boolean arrays?
I am using the following code:
var bit = new Tag<BoolPlcMapper, bool>()
{
Name = "ALARMS_GENERAL.SeriuosAlarms.0",
Gateway = "172.27.7.205",
Path = "1,0",
PlcType = PlcType.ControlLogix,
Protocol = Protocol.ab_eip,
Timeout = TimeSpan.FromSeconds(5)
};
Console.WriteLine($"{bit.Name} value: {bit.Read()}.");
var array = new Tag<BoolPlcMapper, bool[]>()
{
Name = $"ALARMS_GENERAL.SeriuosAlarms",
Gateway = "172.27.7.205",
Path = "1,0",
ArrayDimensions = new int[] { 64 },
PlcType = PlcType.ControlLogix,
Protocol = Protocol.ab_eip,
Timeout = TimeSpan.FromSeconds(5)
};
Console.WriteLine($"{array.Name} value: {array.Read()}.");
ALARMS_GENERAL.SeriuosAlarms is a LINT variable, I can correctly read single bits, but i cannot read the LINT as bool array. The array initializer method raises an exception and returns ErrorOutOfBounds.
Any help would be greatly appreciated,
Thanks in advance
The text was updated successfully, but these errors were encountered:
Within the PLC and within the CIP protocol, data access to tags is typed and the type of the access must match the type of the tag. That said, you can use the bit accessor functions (change to camel-case for C#/.NET I think) to get individual bits. You could write your own mapper with that.
Hi everyone,
Is there a way to read integer types (INT, DINT, LINT) as boolean arrays?
I am using the following code:
ALARMS_GENERAL.SeriuosAlarms is a LINT variable, I can correctly read single bits, but i cannot read the LINT as bool array. The array initializer method raises an exception and returns ErrorOutOfBounds.
Any help would be greatly appreciated,
Thanks in advance
The text was updated successfully, but these errors were encountered: