ScriptName "script parameter BusStateLED" ScriptAuthor "dA/FP" ScriptVersion "1.0" // Rev Vers // This script shows ho the state of the bus may be // detected from a script. SetErrorHandler ( :ErrorAddress ) ; var vbErrorNo : byte ; var vb_State: byte; var vbc_StaticGreen: byte; MoveConst(vbc_StaticGreen, 2); : start; BusStart; // Profibus: // while the bus StateLED is not off the bus is not active. // this behaviour differs from bus to bus. : BusInactive; Get ( BusStateLED , vb_State ) ; if vb_State notequal vbc_StaticGreen then :BusInactive; // now the LED is static green, so the bus is active. // just to show the result we set another LED to on! Set ( RS_State_LED, staticGreen ); stop; :ErrorAddress; // we do not handle any error in this simple script. return;