DeviceNet
Deutschmann Automation GmbH & Co. KG
Script example for the initialization of the Profibus
var InSize: word;
var OutSize: word;
Set (FieldbusID, 4) ;
// this parameter can also be set by the command SetByVar
// var DNAddress: long;
// MoveConst( DNAddress, 4) ; or from the shift registers
// SetByVar();
// Define the baudrate the bus is supposed to be operated with.
// here exemplary 125 kBaud
// This has to take place before the bus-start
Set ( BusBaudrate, 125000 );
// Before the bus-start the participant has to be configured.
// Most important is the setting of the data width,
// Here the values are exemplary.
MoveConst ( Insize, 10) ;
MoveConst ( OutSize, 12 );
SetByVar ( BusInputSize,
InSize );
SetByVar ( BusOutputSize, OutSize );
// Insize and OutSize are from the IC's point of view!!
// Here the values can be set with Set.
// The ProductCode of the participant can also be determined.
// This has to take place before the bus-start
// ! It is not important to set the command Productcode.
// It is possible to set a fixed ProductCode for a script gateway.
// If this value is set to 0 the gateway calculates its product code by
// 256 * consumed size + produced size
// !!! If you like to set a special ProductCode, you MUST set this command after
"BusInPutSize" and "BusOutputSize"
BusStart;
// The DeviceNet is ready. From now the Master CAN configure
// the participant.
// However, this does not mean that the Master has already
// opened up a Poll-connection with the Slave.
wait (Bus_Active);
// The Poll-connection has now been set up by the DeviceNet
// Scanner.
// This command might take a very long time and it cannot
// be interrupted!
// Data can be read out from the bus
// As many bytes as available should be read.
var InBuffer: Buffer[100];
Readbus ( InBuffer[0], InSize) ;
// Now it is possible to write data.
// You must not write more bytes than available.
var OutBuffer: Buffer[100];
WriteBus ( OutBuffer[0], OutSize );
®
28
Instruction manual UNIGATE
IC - DeviceNet V. 2.7
7.10.10
Need help?
Do you have a question about the UNIGATE IC DeviceNet and is the answer not in the manual?