Thank you Godra, alarm works fine !!
No communication to plc is ok now !
Hmi_Alarm_Array[0].0 to 31 works good ! can we use more than 32 alarm ? And what's the purpose of HMI_Alarm_Array[1] to 20 ?
Many thanks !!
Glad you figured things out. I tried to bookmark areas with "TODO_x", those aren't necessarily items that still need completed, but items that may need configured for your specific process - I probably could have picked a better term than TODO.
I use arrays because I feel they are more efficient and easier to use. You can use SINT, INT, DINT, etc., as long as you specify the word length (since the driver isn't capable of knowing data type). This app has been tested with MicroLogix and AD Productivity (Modbus) as well. You define length on line 654:
Private Binary_Length As Integer = 32 'TODO_2
If using CpLX/CLX I would always recommend using DINT, which is 32. Since there isn't an alarm number 0, I skip that and start with 1. So, word
- bit 1 is alarm #1, word
- bit 31 is alarm #31, word [1] bit 0 is alarm #32, etc. There is no limit. You could have 1000s of alarms. This app is setup to use the descriptions from a user defined INI file within the app, as Godra pointed out, or you can use strings from the PLC, line 706:
AlarmDescArray.PLCAddress = "Alarm[" & i & "].Description_ID" 'TODO_6 '
Hope that clarifies things a little better.
James