ACC-72EX User Manual
Software setup
103
// Toggle Communication Channel 0’s Change of State Acknowledge bit in
// order to read the CC0_RCX_COMM_COS_RUN which is a part of Communication
// Channel 0 State Register
HCCC0_HCF_NETX_COS_ACK = HCCC0_HCF_NETX_COS_ACK ^ 1
if
(CommErrorFlag==0)
{
while
((CC0_RCX_COMM_COS_RUN) == 0)
// Wait for comm tasks to
{
// start on COMX modules
// Repeating the toggle action for next while loop read
HCCC0_HCF_NETX_COS_ACK = HCCC0_HCF_NETX_COS_ACK ^ 1
call
Timer(0.010);
// 10 msec
}
enable
plc
Acc72EX_WatchdogPLC
// Enable the Watchdog plc
enable
plc
Acc72EX_PDO_WritePLC
// Enable the write plc
enable
plc
Acc72EX_PDO_ReadPLC
// Enable the read plc
}
disable
plc
Acc72EX_StartupPLC
close
The above PLC uses a Timer subprogram call that must be added to the PMAC Script
Language
Libraries folder of the IDE project:
open
subprog
Timer(wait_duration)
// wait_duration in seconds
local
EndTime = Sys.Time + wait_duration;
while
(Sys.Time < EndTime){}
close
Startup
To enable this startup PLC at power-up or reset, add the following line to pp_startup.txt in the
Configuration folder:
enable plc Acc72EX_StartupPLC
Watchdog Function
The host Watchdog and the device Watchdog cells in the control block of each of the communication
channels allow the operating system running on the netX to supervise the host or UMAC application and
vice versa. There is no Watchdog function for the system block or for the handshake channel. The
Watchdog for the channels is located in the control block of the status block of each communication
channel.
The netX firmware reads the content of the device Watchdog cell, increments the value by one and copies
it back into the host Watchdog location. Then, the application has to copy the new value from the host
Watchdog location into the device Watchdog location. Copying the host Watchdog cell to the device
Watchdog cell has to happen in the configured Watchdog time. When the overflow occurs, the firmware
starts over and a one appears in the host Watchdog cell. A zero turns off the Watchdog and therefore
never appears in the host Watchdog cell in the regular process.
The minimum Watchdog time is 20 ms. The application can start the Watchdog function by copying any
value unequal to zero into device Watchdog cell. A zero in the device Watchdog location stops the
Watchdog function. The Watchdog timeout is configurable in SYCON.net and downloaded to the netX
firmware.