ACC-72EX User Manual
Software setup
104
If the application fails to copy the value from the host Watchdog location to the device Watchdog location
within the configured Watchdog time, the protocol stack will interrupt all network connections
immediately, regardless of their current state. If the Watchdog tripped, then power cycling, channel reset,
or channel initialization will allow the communication channel to open network connections again.
Here is sample code for copying the host Watchdog location to the device Watchdog location:
/****************************************/
// ACC-72EX Watchdog PLC
/****************************************/
open
plc
Acc72EX_WatchdogPLC
CC0_ulDeviceWatchdog = CC0_ulHostWatchdog
// copies the host Watchdog content
// to device Watchdog cell
// for the ACC-72EX
close
Enabling the Communication Bus
Using the Bus On flag (CCx_RCX_APP_COS_BUS_ON, where x is the communication channel
number), the host or UMAC application allows or disallows the netX firmware to open network
connections. This flag is used together with the Bus On Enable flag
(CCx_RCX_APP_COS_BUS_ON_ENABLE, where x is the communication channel number). If set, the
netX firmware tries to open network connections; if cleared, no connections are allowed, and open
connections are closed. If the Bus On Enable flag is set, it enables the execution of the Bus On command
in the netX firmware.
CC0_RCX_APP_COS_BUS_ON=1
// Setting the Bus On flag for 1st ACC-72EX
CC0_RCX_APP_COS_BUS_ON_ENABLE=1
// Enabling the execution of Bus On Flag for 1st ACC-72EX
S_CC0_RCX_APP_COS_BUS_ON=1
// Setting the Bus On flag for 2nd ACC-72EX
S_CC0_RCX_APP_COS_BUS_ON_ENABLE=1
// Enabling the execution of Bus On Flag for 2nd ACC-72EX
Locating the Input/Output Data Image in PMAC
The header file provided for use with ACC-72EX provides proper addressing and offsets for each of the
PDOs available for each communication module. There are also pointers declared in the header file and
are defined as a part of the initialization PLC shown above. These pointers will be used to access different
PDOs defined by SYCON.net software.
The following example PLCs are for reference only in order to demonstrate the proper handshaking
necessary for reading and writing data to ACC-72EX from Power PMAC.
/****************************************/
// ACC-72EX Writing to PDO Sample PLC
/****************************************/
open
plc
Acc72EX_PDO_WritePLC
if
(HCCC0_HCF_PD0_OUT_CMD == HCCC0_NCF_PD0_OUT_ACK)
{
// Making sure the ACK flag matches the CMD
// flag before writing the value to the
// output data image register
P200
=
P200
+1
CC0_PD0_OUT16(0)=
P200
;
// write the output data image register
// Toggle the CMD flag (^: XOR)
HCCC0_HCF_PD0_OUT_CMD = HCCC0_HCF_PD0_OUT_CMD^1
// indicating write completion
}
close
/****************************************/