Using Programming CommandsSAC and the Program BlockWhen SAC scans a Program block, it generally runs all of the block's commands within one scan period. After scanning the Program block, SAC does not scan it again unless:
Delaying Program CommandsCertain commands limit a test command's duration. For example, you may want to use the WAITFOR command to have the Program block wait for an Analog Input block to receive a value of 50 before it proceeds to the next command. However, if the Analog Input block never receives a value of 50, the remaining commands never execute. To avoid this result, you can use the MAXWAIT command. This command specifies how long the block waits before it automatically goes onto the next command. You could then use the GOTO command to tell the Program block to jump to a particular command found later in the programming sequence. For example: 09 MAXWAIT 60 In this example, the block waits 60 seconds before executing the GOTO command. The GOTO command specifies that step 16 is the next step to execute. If you set up a command that waits a long time to complete, you should also include a command that notifies you when the wait ends. This method allows you to determine if an event has occurred. For example: 04 WAITFOR AI1 = 50 In this example, the message "AI1 IS NOW 50" prints only when AI1 has successfully reached a value of 50. If AI1 never reaches 50, the message is not sent to the enabled alarm destinations. Clamping ValuesIf the Program block sends a value to another block and the value exceeds a target block's EGU range, iFIX clamps the value to the block's high and low EGU limits. For example, if you SETOUT a value of 150 to a block whose EGU range is 0 to 100, the setout value is clamped at 100. Execution ErrorsThe Program block goes off scan whenever it cannot execute a command. Prior to going off scan, the block sends a message to all the enabled alarm services in its alarm areas. The off scan message explains at what line the block stopped and why. Make sure you test your Program blocks thoroughly before placing it in actual operation. You can use the debugging commands, SETDEBUG and CLRDEBUG, to help test your Program blocks before placing them online.
|
Important Notice You do not have the latest version of iFIX! You are missing out on the newest capabilities and enhanced security. For information on all the latest features, see the iFIX product page. For more information on upgrades, contact your GE Digital sales agent or e-mail GEDClientServices@gevernova.com. For the most up-to-date documentation, go here. |
![]() |