Home

RIO-47100 Command manual

image

Contents

1. Examples AFO 1 AZ0 1 Set analog input output on A and B DB 57 26 Set deadband on A and B MG_DBA Query DB setting on A axis 60 DH DHCP Server Enable Full Description The DH command configures the DHCP or BOOT P functionality on the controller for Server IP addressing Arguments DH n where n 0 disables DHCP and enables BOOT P n 1 disables BOOT P and enables DHCP n returns the current state of the setting Usage Usage and Default Details Controller Usage DMC 40x0 RIO 47xxx Default Value Default Format Operand Usage N A Related Commands IA IP Address Examples DH 1 Sets the DHCP function on IA assignment will no longer work IP address cannot be burned Controller will receive its IP address from the DHCP server on the network DH 0 Sets the DHCP function off and the Boot P function on 61 DL Download Full Description The DL command transfers a data file from the host computer to the controller If the DL command is used in a terminal utility such as Hyper Terminal a file will be accepted as a datastream without line numbers In this case the file is terminated using control Z control Q control D or If no parameter is specified downloading a data file will clear any programs in the controller board s RAM The data is entered beginning at line 0 If there are too many lines or too many characters per line the controller will return a To download a program after a l
2. L K Lock program Full Description lt control gt L lt control gt K locks user access to the application program When locked the ED UL LS and TR commands will give privilege error 106 The application program will still run when locked The locked or unlocked state can be saved with a BN command Upon master reset the controller is unlocked Once the program is unlocked it will remain accessible until a lock command or a reset with the locked condition burned in occurs Arguments lt control gt L lt control gt Kpassword n where When n is 1 this command will lock the application program When n is 0 the program will be unlocked Operand Usage N A Usage Usage and Default Details Controller Usage DMC 40x0 DMC 18x6 RIO 47xxx Default Value Default Forma Related Commands PW Password ED Edit program UL Upload program LS List program TR Trace program Examples PWtest test Set password to test L K test 1 Lock the program LS Attempt to list the program ip STET 106 Privilege violation 32 ARAS Master Reset Full Description The Master Reset command resets the RIO to factory default settings and erases EEPROM A master reset can also be performed by installing a jumper at the location labeled MRST and resetting the board power cycle or pressing the reset button Remove the jumper after this procedure Note Sending a R S over an Ethernet connection will cause the IP address
3. Operand Usage N A Usage Usage and Default Details V N Y N Ina Program Controller Usage Default Value null In a Program Yes Default Format Command Line Yes Related Commands MA Set Email Server IP Address MD Set Mail Destination Address Examples MA 10 0 0 1 xample smtp email server ip MD someone example com sample email address MG Testing Email M Message to send via Email 114 MV Modbus Reversal Full Description Enabling the MV command causes the RIO to change the way it responds to function codes 3 and 4 Some modbus software packages may require function codes 3 and 4 to be switched Note Use of the Galil commands AN AO require MV to be set to 0 Arguments MV n where n 0 The RIO responds to function code 3 with analog input information and function code 4 with analog output information n 1 The RIO responds to function code 3 with analog output information and function code 4 with analog input information n Returns the state of the MV command 0 or 1 Operand Usage _MV can not be used as an operand Usage Usage and Default Details While Moving Default Value fo Related Commands MB Modbus MW Modbus Wait Examples MV1 RIO to respond to code 3 with analog output and code 4 with analog input information 115 MW Modbus Wait Full Description Enabling the MW command causes the controller to hold up execution of the
4. MG z print return value EN subroutine integer remainder of x y 10 mod 3 1 arguments are x and y Return is in z mod z x y INT x y EN 26 OUT Read digital output Full Description Returns the value of the given digital output either 0 or 1 Arguments OUT n where n is an unsigned integer in the range 0 to 15 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands ANJ n Read analog input IN n Read digital input SB Set digital output bit CB Clear digital output bit OF Set analog output offset Examples MG OUT 1 print digital output 1 21 0000 x OUT 1 assign digital output 1 to a variable 27 RND Round Full Description Rounds the given number to the nearest integer Arguments ARNDIn n is a signed number in the range 2147483648 to 2147483647 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands AINT n Truncates to the nearest integer Examples MG RND 1 2 1 00 MG 6 0 ie D 0 D 5 7 0 D QRO 0 oO 0 R 00 ER 00 ER 00 ER 00 ER 00 MG D 5 5 SIs 0 28 SIN Sine Full Description Returns the sine of the given angle in degrees Arguments SIN n where n is a signed number in degrees in the range of 32768 to 32767 with a fractional resolution of 16 bit Operand Usage N A Usa
5. contains a 2 if it is for a TCP master contains a 5 while attempting to establish a UDP handle contains a 6 while attempting to establish a TCP IP handle _IHh3 contains a 0 if the ARP was successful contains a 1 if it has failed or is still in progress 84 _THh4 contains a 1 if the master controller is waiting for acknowledgment from the slave after issuing a command contains a 2 if the master controller received a colon from the slave after issuing a command contains a 3 if the master controller received a question mark from the slave after issuing a command contains a 4 if the master controller timed out while waiting for a response from the slave after issuing a command Usage Usage and Default Details While Moving Default Value 0 0 0 0 Default Format Related Commands IA Internet Address Examples IHA 251 29 51 1 Open handle A at IP address 251 29 51 1 TCP is used as default THA 2095238399 Open handle A at IP address 251 29 51 1 slave device befor opening a handle This operation can cause a small time delay before th controller responds Setting and printing the time with a TIME protocol server RIO 471x2 only set RO 7 set the timezone offset for California Pacific Daylight Time THE gt 3 close handle E in case it s open IHE 10 0 62 23 lt 37 gt 2 querry the TIME server WT10 Wait briefly for the transaction to occur G RO1 8 0 display the raw data r
6. IQn where n is an integer value 0 65535 representing the 16 digital inputs Operand Usage _IQn contains the current setting Usage Usage and Default Details Controller Usage Default Value o Default Format Related Commands Examples 10255 This sets bank0 inputs to show current not flowing is logic 0 10192 This sets outputs 6 and 7 to show current not flowing is logic 0 91 JP Jump to Program Location Full Description The JP command causes a jump to a program location on a specified condition The program location may be any program line number or label The condition is a conditional statement which uses a logical operator such as equal to or less than A jump is taken if the specified condition is true Multiple conditions can be used in a single jump statement The conditional statements are combined in pairs using the operands amp and The amp operand between any two conditions requires that both statements must be true for the combined statement to be true The operand between any two conditions requires that only one statement be true for the combined statement to be true Each condition must be placed in parenthesis for proper evaluation by the controller Example JP a var0 1 8 varl 2 valid conditional jump JPta var0 18varl 2 invalid conditional jump Arguments JP location condition where location is a program line number or label condition is a conditional statem
7. P1NM Serial port number P1ST Serial port string maximum length of 6 characters CI Configure COMINT and set operator data entry mode EN End subroutine Examples CLl2 5s Loop MG Loop WT 1000 JP Loop COMINT G COMINT P1CH EN1 1 function which runs in thread 0 Use interrupt on any character print a messag very second print character received OTE An application program must be executing for the automatic subroutine to EN to end the routine 10 TCPERR Ethernet communication error automatic subroutine Full Description The following error see TC occurs when a command such as MG hello EA is sent to a failed Ethernet connection 123 TCP lost sync or timeout This error means that the client on handle A did not respond with a TCP acknowledgement for example because the Ethernet cable was disconnected Handle A is closed in this case FTCPERR allows the application programmer to run code for example to reestablish the connection when error 123 occurs Arguments N A Operand Usage N A Usage Usage and Default Details While Moving Related Commands TC Tell error code _TA4 Last dropped handle MG Print message SA Send ASCII command via Ethernet Examples L MG EA L WT1000 JP L TCPERR G P1 TCPERR Dropped handle _IA4 RE NOTE Use RE to end the routine 11 Hexadecimal Full Descri
8. Real Year Calendar Function Full Description Available only on RIO 471x2 with realtime chip upgrade RY provides a calender feature for the realtime chip Available information is day of week day of month month of year and year RY can be set manually or automatically with the TIME protocol See IH The calender function is leap year compliant Arguments RY dw dm m y Where dw is the current day of the week 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday 7 Saturday dm is the current day of the month 1 31 m is the current month of the year 1 January 2 February 3 March 4 April 5 May 6 June 7 July 8 August 9 September 10 October 11 November 12 December y is the current year 0 99 corresponding to 2000 through 2099 Operands _RYO contains the current day of the week field _RY1 contains the current day of the month field _RY 2 contains the current month of the year field _RY3 contains the current year field Usage Usage and Default Details Default Value 0 0 0 0 Related Commands RY Real Year Calendar Function RO Realtime Offset IH Open IP Handle Examples RY6 19 2 10 Set to Fri February 19th 2010 REM DISABLE COMPRESSION lt This String Disables GalilTools Compression Print call sub when time is needed JS PrintD RY0 helper subs w offsets JS PrintM RY2 141 G RY1 Z2 0 N print info G2000 RY3 Z4 0 G_RT2 F
9. THE 10 0 62 23 lt 37 gt 2 WT10 JS Print N Print Print Time G_RT2 F2 0 N Hour G_RT1 F2 0 N Minute G_RTO0 F2 0 Second E EN SAMPLE OUTPUT 23 6 E LO 230 16 137 RS Reset Full Description The RS command resets the state of the processor to its power on condition The previously saved state of the hardware along with parameter values and saved program are restored RS 1 Soft master reset Restores factory defaults without erasing EEPROM To restore saved EEPROM settings use RS with no arguments Arguments Operand Usage _RS returns the state of the processor on its last power up condition The value returned is the decimal equivalent of the 4 bit binary value shown below Bit 3 For master reset error there should be no program to execute Bit 2 For program check sum error Bit 1 For parameter check sum error Bit 0 For variable check sum error Usage Usage and Default Details Y Fina Program Controller Usage Default Value Default Format In a Program No Command Line Yes Can be Interrogated Yes Used as an Operand Yes Related Commands Examples RS Reset the hardware 138 RT Real Time Full D Available on RIO 471x2 only RT provides the ability to set and querry the current time on the RIO realtime clock escription The RIO 471x2 has two clock options 1 Processor RTC Clock does not persist through power cycles and must
10. The CF command directs the controller to send unsolicited responses to the Main or Aux Serial Port If equipped or to an Ethernet handle An unsolicited message is data generated by the controller which is not in response to a command sent by the host Examples of commands that will generate unsolicited messages follow These commands are unsolicited only when in embedded code NOT when sent from a host MG Hello A message MG Tel A command that returns a response TP 1 RPA Y var A variable interogation var m thisIsAnError A dmc error will generate an error messag Arguments CFn where n ia A B C for Ethernet handles and S for the serial port On RIO 47xx2 n can be A B C D E Operands _CF contains the decimal value of the ASCII letter where unsolicited messages are currently routed Usage Usage and Default Details While Moving Related Commands CW Configures MSB of unsolicited messages WH What Handle TH Tell Handles Examples CFI Send to me Sent from external hardware only CFI directs unsolicited traffic to the port that sent the command When communicating over Ethernet two Ethernet handles should be used 1 The first handle should be used for command and response traffic This is the primary handle that the host uses to communicate to the controller 54 2 The second handle should be used for unsolicited traffic This is the primary handle that the c
11. U analog out 3 counts U analog out 4 counts U analog out 5 counts U analog out 6 counts U analog out 7 counts U analog in 0 counts U analog in 1 counts U analog in 2 counts U analog in 3 counts U analog in 4 counts U analog in 5 counts U analog in 6 counts U analog in 7 counts U output state UW input state UW pulse count UL ZC data SL ZD data SL W W W W W W W W ELE EZ Operand Usage _DR contains the data record update rate Usage Usage Default Details Fina Program Controller Usage EA Default Value Default Format i Default Value DRO off In a Program Yes Default Format Command Line Yes 65 Related Commands QR Query a single data record Examples DR8 0 GUx j P P HOOO O00P popoo00 000P0 DRO Note The data record is in a binary is normal when printing to the terminal non printable format the output above 66 DY PWM output duty cycle Full Description DY sets the PWM duty cycle of the RIO 471xx configurable PWM outputs 14 and 15 The PWM option is necessary for precise resolution of the duty cycle See the RIO user manual for more information With the PWM option the accuracy of the PWM output is 0 5 of the DY setting Arguments DY n n Where First argument corresponds to output 14 second to output 15 n is an in
12. DMC 21x2 3 and RIO only n 0 Do not interrupt n 1 Interrupt on carriage return n 2 Interrupt on any character n 1 Clear interrupt data buffer RIO And DMC 21x2 3 m 0 Default received serial port data is interpreted as Galil command returning data to the port as a standard interpreted port m 1 Enable serial port for CI execution Data received will not be interpreted as a command Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands CC Configure communications IN Communication input MG Message output Examples CI 2 1 Interrupt on a single character received on DMC 21x2 3 serial port 56 CL Control Loop Full Description The CL command allows the user to select the update rate in milliseconds for the optional control loops The default update rate is Imsec Arguments CL n where n is an integer in the range of 1 to 65535 that represents the update rate in milliseconds Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands Examples CL 25 25msec update rate AF 0 analog input 0 as feedback AZ 0 analog output 0 as control KP 1 proportional gain to 1 KD 10 derivative gain to 10 KI 0 5 integral gain to 0 5 DB 0 1 deadband of 0 1V Ps 1 8 set point at 1 8V CW Copyright information Data Adjustment bit on off Full Description The CW command has a
13. IF is false ENDIF End of 2nd conditional statement ELSE ELSE command for lst IF conditional statement G ONLY INPUT 2 IS ACTIVE Executed if lst IF is false ENDIF End of lst conditional statement 69 EN End Full Description The EN command is used to designate the end of a program or subroutine If a subroutine was called by the JS command the EN command ends the subroutine and returns program flow to the point just after the JS command Note Instead of EN use the RE command to end the error subroutine and limit subroutine Use the RI command to end the input interrupt subroutine The EN command is also used to end the automatic subroutines CMDERR and COMINT and an argument is required to handle trippoints in the main thread upon returning from the subroutine When the EN command is used to terminate the COMINT communications interrupt subroutine there are two arguments the first determines whether trippoints will be restored upon completion of the subroutine and the second determines whether the communication interrupt will be re enabled Arguments EN m n where m 0 Return from subroutine without restoring trippoint in main thread m 1 Return from subroutine and restore trippoint in main thread n 0 Return from COMINT without restoring CI interrupt trigger n 1 Return from COMINT and restore Cl interrupt trigger Note 1 The default value for the argument is 0 For example ENO and EN have the same effect N
14. II Input interrupt ININT Label for input interrupt TI Tell Inputs IQ Configure Inputs Examples Apt Begin Program AI 7 amp 15 amp 1 amp 12 Wait until inputs 7 amp 15 are high G DONE Send message EN End Program DONE ry when conditions are satisfied and inputs 1 amp 12 are low 42 AO Analog Output Full Description The AO command sets the analog output voltage on an analog output pin It is also used to set the analog output voltage on ModBus devices over Ethernet For RIO 4712x models the output voltage range can be adjusted using the DQ command Use the ID command to check your model number and I O configuration Note The RIO 472xx does not have any analog outputs by default Arguments AO m n where m is the I O number assigned to a particular analog output pin 0 7 m can also be the I O number of a ModBus device that is calculated using the following equations m HandleNum 1000 Module 1 4 Bitnum 1 HandleNum is the handle specifier from A to C 1 to 3 Module is the position of the module in the rack from 1 to 16 BitNum is the I O point in the module from 1 to 4 n analog output voltage Default is 12bit resolution RIO 4712x 16 is 16bit resolution Usage Usage and Default Details Controller Usage Default Value Default Format Operand Usage N A Related Commands SB Set Bit CB Clear Bit MB Modbus DQ Set analog output rang
15. Input AF Analog Feedback PS Control Loop Setpoint Examples CL 25 25msec update rate AF 0 analog input 0 as feedback AZ 0 analog output 0 as control proportional gain to 1 1 KD 10 derivative gain to 10 KI 0 5 integral gain to 0 5 DB 0 1 deadband of 0 1V Ps 1 8 set point at 1 8V 48 BK Breakpoint Full Description For debugging Causes the controller to pause execution of the given thread at the given program line number which is not executed All other threads continue running Only one breakpoint may be armed at any time After a breakpoint is encountered a new breakpoint can be armed to continue execution to the new breakpoint or BK will resume program execution The SL command can be used to single step from the breakpoint The breakpoint can be armed before or during thread execution Arguments BK n m where n is an integer in the range 0 to 199 which is the line number to stop at n must be a valid line number in the chosen thread m is an integer in the range 0 to 3 that corresponds to the thread number you want to pause Operand Usage _BK will tell whether a breakpoint has been armed whether it has been encountered and the program line number of the breakpoint LineNumber breakpoint armed LineNumber breakpoint encountered 2147483648 breakpoint not armed Usage Usage and Default Details While Moving No RIO Related Commands SL Single Step TR T
16. RIO MW1 Turn on modbus wait DM write 2 Dimension an array for holding data to transmit write 0 1234 Assign an integer to element 0 MBH 0 16 1000 1 write Send the integer to register 1000 on the RIO 471x2 write 0 S 42F6 Set the 32 bit float in two steps the value is 123 456 write 1 E978 MBH 0 16 2001 2 write Send the float to register 2001 on the RIO 471x2 note that register 2000 would have stepped on the integer memory written at 1000 DM read 2 Dimension an array for holding read data BH 0 3 1000 1 read Read the integer at register 1000 G Integer read 0 Print the read integer BH 0 3 2001 2 read Read the float at register 1000 float read 0 10000 read 1 Construct the float Shifting necesary for high bytes G Float float 8 0 Print the float in hex Hint A useful utility for determining the 32 bit floating point value for a given fractional number can be found here http www purl oclc org vickery IEEE 754 Decimal html 110 MG Message Full Description The MG command transmits data from the RIO board This can be used to alert an operator send instructions or return a variable value Arguments MG m m Ex n V Fm n or m n N Sn M m is a text message including letters numbers symbols or lt ctrl gt G Make sure that maximum line length of 40 characters is not exceeded Ex for ethernet and x specifies the ethernet handle A B
17. RR A 111 DMD E NETE E E E A ec ino adh acne AN 113 E NE EEN TA ENEA E E VEE I ES e de 114 A IN A IA A A A S PENA 115 IW iia ta AAA 116 INO AEO tea O A E TE ears 117 NN 118 A A A RCC CPN Or i RET 7 ET 119 CUA hoe coh A land sh aR ES 120 Prepa O PEE ET E NIT tantanencantes 121 AN et ce EAN S A een et 122 TS coe ahd chest Br con dees it acces E ee naka RO 123 A O 124 O feat ta O A Dt toad dat OR beat 125 T EN NI II 126 EN AI AN Al 128 A E A A A NO 129 POG Seed dae ashlar A ceca seal aceite eN hc SA a dl tants 130 CR ene Mb rt reste ne ey Ra E a Me nL Reeve OS 131 IN eit aN vee adam tk 132 FR reese a neste cael ee A tae enh ee 133 PB Nate A A A O Anat 134 A A A A 135 A AAN 136 Pee tert ca an ara Mia Mitek al hehe le ROE e ato Desa 138 Ae sae ethan tie SEAT E cma hasianeat ta te ncemd di cin T 139 A SUTTON TUT TIN ORME AER OnE ROT STN SO HEI OnE 141 S cof cite elena A ts uted 143 A A RR t 145 A RR A TT 146 A EE A lB il aed 147 A NN ANNA IIS at 148 BO cuentas inch fa ne tte poe emcee een nett ne a A A 149 CT ask scree cl klein eluates on A A 152 OU ate AA AA Oe ye A 153 a saa RAN Nels AA 154 iE O 1 esc oh Male da E Sie 155 A O A A A 156 A A E O T 157 A IA A E A T A 158 A A A AN A OS 159 AN 160 A A RN MN O 161 E meee cae 162 TA asin on deh ae AGA lie 163 AE T N TEA EE ON 164 Label subroutine Full Description The operator denotes the name of a program label for example Move Labels can be up to seven characters lon
18. Usage Usage and Default Details While Moving No RIO Related Commands TCPERR Error Subroutine Examples L MG EA L WT1000 JP L TCPERR MG P1 TCPERR Dropped handle _IA4 RE 133 REM Remark Full Description REM is used for comments The REM statement is NOT a controller command Rather it is recognized by Galil PC software which strips away the REM lines before downloading the DMC file to the controller REM differs from NO or in the following ways 1 NO or comments are downloaded to the controller and REM comments aren t 2 NO or comments take up execution time and REM comments don t therefore REM should be used for code that needs to run fast 3 REM comments cannot be recovered when uploading a program but NO or comments are recovered Thus the uploaded program is less readable with REM 4 NO or comments take up program line space and REM lines don t 5 REM comments must be the first and only thing on a line whereas NO or can be used to place comments to the right of code after a semicolon on the same line NO or should be used instead of REM unless speed or program space is an issue Arguments REM string where string is a text comment Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands NO apostrophe also accepted No operation comment Examples REM This comment will be stripped
19. a certain voltage For example IL 2 limits the output of the integrator of the A channel to the 2 Volt range AF AZ must be set prior to adjusting IL Note the output from the KD and KP terms is not affected For further details see the Process Control section in the User s Manual Arguments IL n n or ILm n n is a positive number whose range is 0 5V on the RIO 4710x and is determined by the DQ command on the RIO 4712x Resolution for both is 0 0001 n Returns the value of the integrator limit m A B RIO 47xx2 has 6 control loops ILn n n n n n and m A B C D E F Operand Usage _ILm contains the integrator limit for the specified control loop Usage Usage and Default Details While Moving Default Value 5 In a Program Yes Default Format Command Line Yes Related Commands KI Integrator Examples AFO 1 Set analog feedback AZO 1 Set analog output Lie Se Integrator limits IL Returns the first limit 3 0000 89 IN Input Variable Full Description The IN command allows a variable to be input from a keyboard When the IN command is executed in a program the prompt message is displayed The operator then enters the variable value followed by a carriage return The entered value is assigned to the specified variable name The IN command holds up execution of following commands in a program until a carriage return or semicolon is detected If no value is given prior to a semicolon or carriage return
20. an Operand No Related Commands BN Burn Parameters BV Burn Variables Examples Note This command may cause the Galil software to issue the following warning A time out occurred while waiting for a response from the controller This warning is normal and is designed to warn the user when the controller does not respond to a command within the timeout period This occurs because this command takes more time than the default timeout period The timeout can be changed in the Galil software This warning does not affect the operation of the board or software 51 BV Burn Variables and Array Full Description The BV command saves the controller variables and arrays in non volatile EEPROM memory This command typically takes up to 2 seconds to execute and must not be interrupted The controller returns a when the Burn is complete The RIO product line has a maximum of 10 000 write cycles for burning BV BP BN combined Arguments None Operand Usage Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands BN Burn Parameters BP Burn Program Note This command may cause the Galil software to issue the following warning A time out occurred while waiting for a response from the controller This warning is normal and is designed to warn the user when the controller does not respond to a command within the timeout period This occurs because this command takes
21. are the 10 major function codes of the second level Modbus support is for TCP IP Note For those command formats that have addr this is the slave address The slave address may be designated or defaulted to the device handle letter Note All the formats contain an h parameter This designates the connection handle letter A thru H Note Port 502 must be used in the Ethernet handle See the IH command for more info on how to open a handle with a specific port number Level 2 Modbus Function Codes 06 Preset Single Register Write One Word _ Write Digital Outputs RIO only 7 Report stage o Function codes 3 and 4 can be swapped with the MV command By default the Unit ID is equal to the handle number the connection is over Handle A gives a Unit ID of 0x01 Arguments MBh addr 1 m n array where h is the handle letter addr is the unit ID 1 is the function code 1 Read Coil Status m is the address of the first coil n is the quantity of coils array is the name of the array whose first element will store the response MBh addr 2 m n array where h is the handle letter addr is the unit ID 2 is the function code 2 Read Input Status m is the address of the first coil n is the quantity of coils array is the name of the array whose first element will store the response MBh addr 3 m n array where h is the handle letter addr is the unit ID 3 is the function code 3 Read Holding Re
22. arrays DA 0 Deallocate all variables and all arrays OTE Since this command deallocates the spaces and compacts the array spaces in the memory it is possible that execution of this command may take longer time than a standard command Variables and arrays that are deallocated are not set to zero A routine that writes zeros to the array and or variables should be created if this is desired 59 DB Deadband Full Description The DB command selects the deadband where the error must exceed the deadband to execute the control loop Note AF and AZ commands must be set prior to the DB command Arguments DB n n or DBm n where n is a decimal value in the range of 1 000V to 1 0000V n returns the value for the specified control loop m A B RIO 47xx2 has 6 control loops DBn n n n n n or DBm n where m A B C D E F A negative value for n will place the RIO in a velocity or flow control mode In this mode the output from the PID filter is held when the feedback is within the deadband range With a positive value for n the output of the PID filter is cleared set to 0 when the deadband is reached Operand Usage _DBm contains the dead band for the specified control loop Usage Usage and Default Details While Moving Default Value fo Default Value 0 In a Program Yes Default Format Command Line Yes Related Commands AF Analog Feedback Select AZ Analot Output Select CL Control Loop PS Setpoint
23. be set at startup either by RT command or by TIME protocol over Ethernet See IH 2 Precision RTC chip Upgrade option for the RIO 41x2 More precise than processor RTC feature Persists time through power cycle Provides calendar function See RY RT can be set manually or automatically with the TIME protocol See IH Arguments RTs m h Where s is current seconds value 0 59 m is current minutes value 0 59 h is the current 24 hour clock hour value 0 23 Operands _RTO contains the seconds field of the current time _RTI contains the minutes field of the current time _RT2 contains the hours field of the current time _RT3 RIO 471x2 without precision RTC circuitry contains the days since the time was last set with the RT command or with the TIME protocol If neither event occured RT3 contains the number of days since last power cycle With the precision RTC upgrade use _RYO for the day of week counter Usage Usage and Default Details Default Value Related Commands RY Real Year Calendar Function RO Realtime Offset IH Open IP Handle Examples IH RT 30 25 22 Set time to RO 7 set timezone E 10 0 62 23 lt 37 gt 2 hit TIM WT10 MG_RO1 8 0 print data from server MG _RT2 F2 0 N print hour 10 25 30 PM E server 139 G_RT1 F2 0 N print minutes G RTO F2 0 print seconds EN Sample Output SCF943C7B r 13 28 43 140 RY
24. is the number of bytes following the header in the incoming data to keep array2 is the incoming data array with a dimension of at least len3 Note each element of array2 will contain only one byte Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands IA IP Address MW Modbus Wait MV Modbus Reversal MI Modbus Integer Examples IHH gt 3 Close handle if open IHH 192 168 1 66 lt 502 Establish connection on port 502 Modbus port WT100 Open loop wait see operands in IH W1 Turn on Modbus Wait i 2000 Set address variable BH 6 1 3333 Write to register EN 107 MD Email Destination Address Full Description The MD command sets the email destination address max 30 characters default is null which yields no email transactions Arguments MD string where string is the email address to send to Operand Usage N A Usage Usage and Default Details While Moving Default Value null In a Program Yes Default Format Command Line Yes Related Commands MA Set Email Server IP Address MS Set Mail Source Address Examples 108 ME Modbus array write enable Full Description The RIO provides array access for reading and writing over Modbus TCP IP 1000 elements are available in the RIO 471x2 array table and 400 in the RIO 471x0 and RIO 47200 Each element is accessible as a 16 bit unsigned inte
25. m n array where h is the handle letter addr is the unit ID 16 is the function code 16 Write Multiple Registers m is the address of the first Register n is the quantity of registers array is the name of the array that will store the desired register data 2 byte per element MBh addr 17 array where h is the handle letter addr is the unit ID 17 is the function code 17 Report Slave ID array is where the returned data is stored not supported on RIO Raw Modbus Packet Send MBh 1 len array where h is the handle letter len is the number of bytes in the array array is the array containing the outgoing data with a dimension of at least len 106 Note each element of array may contain only one byte and array must contain the entire modbus packet including transaction identifiers protocol identifiers length field modbus function code and data specific to that function code Raw Modbus Packet Send Receive MBh 1 len array len2 len3 array2 where h is the handle letter len is the number of bytes in the array array is the array containing the outgoing data with a dimension of at least len Note each element of array may contain only one byte and array must contain the entire modbus packet including transaction identifiers protocol identifiers length field modbus function code and data specific to that function code len2 is the number of bytes in the incoming data to discard len3
26. negative m specifies hexadecimal format When in hexadecimal the string will be preceded by a and Hex numbers are displayed as 2 s complement with the first bit used to signify the sign n represents the number of digits after the decimal point m Returns the value of the format for variables and arrays Operand Usage _VF contains the value of the format for variables and arrays Usage Usage and Default Details Default Format In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand Yes Related Commands Examples VF 5 3 Sets 5 digits of integers and 3 digits after the decimal point VF 8 0 Sets 8 digits of integers and no fractions VF 4 0 Specify hexadecimal format with 4 bytes to the left of the decimal 159 WH Which Handle Full Description The WH command is used to identify the handle in which the command is executed on The command returns IHA JHB or IHC to indicate on which handle the command was executed on in the RIO 47xx0 or IHA IHB IHC IHD IHE on the RIO 47xx2 The command returns RS232 if using serial communication Arguments None Operand Usage _WH contains the numeric representation of the handle in which a command is executed Handles A Eare indicated by the value 0 4 while a 1 indicates the serial port Usage Usage and Default Details While Moving No RIO Yes No on 21x3 Related Commands HS Handle Swap IA IP address IH Internet Handle TH T
27. of seconds since midnight January 1 1900 GMT Only TCP is supported on the RIO The Command RO is used to set the timezone offset from GMT Arguments THh ip0 ip1 ip2 ip3 lt p gt q THh n lt p gt q THh gt r where h is the handle ip0 ip1 ip2 ip3 are integers between 0 and 255 and represent the individual fields of the IP address These values must be separated by commas n is a signed integer between 2147483648 and 2147483647 This value is the 32 bit IP address and can be used instead of specifying the 4 address fields lt p specifies the port number of the slave where p is an integer between 0 and 65535 This value is not required for opening a handle gt q specifies the connection type where q is 0 for no connection 1 for UDP and 2 for TCP IHS gt r closes the handle that sent the command where r 1 for UDP IP or r 2 for TCP IP or 3 for either IHT gt r closes all handles except for the one sending the command where r 1 UDP or r 2 TCP or 3 for either gt r specifies that the connection be terminated and the handle be freed where r is 1 for UDP 2 for TCP IP or 3 for TCP IP Reset IHh returns the IP address as 4 1 byte numbers Operand Usage _THh0 contains the IP address as a 32 bit number _IHh1 contains the slave port number _IHh2 contains a 0 if the handle is free contains a 1 if it is for a UDP slave contains a 2 if it is for a TCP slave contains a 1 if it is for a UDP master
28. or C for sending the message through Ex can be replaced by P1 to send the message through the serial port These settings are only needed when the user wants to specify another return port than the one set by the CF command n is an ASCII character specified by the value n V is a variable name or array element where the following specifiers can be used for formatting Fm n Display variable in decimal format with m digits to left of decimal and n to the right m n Display variable in hexadecimal format with m digits to left of decimal and n to the right N Suppress carriage return line feed Sn Display variable as a string of length n where n is 1 thru 6 M emails the message out through an SMTP email server see MA MS and MD commands Note Multiple text variables and ASCII characters may be used each must be separated by a comma Formatting fields are optional Note The order of arguments is not important Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Variable Format In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands Examples Case 1 Message command displays ASCII strings MG Good Morning Displays the string Case 2 Message command displays variables or arrays MG The Answer is Total F4 2 Displays the string with the content of variable TOTAL in local format of 4 digits before and 2 digit
29. running GalilTools Note Do not download arrays from GalilTools or call the arrayDownload or arrayDownloadFile apis while Automatic Record Array Mode is running Arguments RC n m where n is an integer 1 thru 8 and specifies 2 n samples between records RC 0 stops recording m is optional and specifies the number of records to be recorded If m is not specified the array bounds will be used A negative number for m causes circular recording over array addresses 0 to m 1 n Returns status of recording 1 if recording 0 if not recording Note The address for the array element for the next recording can be interrogated with RD Operand Usage _RC contains status of recording 1 if recording 0 if not recording Usage Usage and Default Details While Moving No RIO Controller Usage Default Value o Related Commands DM Dimension Array RD Record Data RA Record Array Mode Examples RECORD Record label DM Torque 1000 Define Array RA Torque Specify Array to record data RD TTA Specify Data Type REZA Begin recording and set 4 msec between records JG 1000 BG Begin motion A JP A RC 1 Loop until done G DONE RECORDING Print message EN End program 131 RD Record Data Full Description The RD command specifies the data type to be captured for the Record Array RA mode The command type includes DATA TYPE MEANING _TI Input status 0 1
30. the previous variable value is kept Input Interrupts will still be active Arguments IN m n So where m is the prompt message May be letters numbers or symbols up to maximum line length and must be placed in quotations Make sure that maximum line length of 40 characters is not exceeded n is the name of variable to hold value returned from input So specifies string data where o is the number of characters from 1 to 6 Not required if the data is numerical Note 1 Do not leave a space between the comma and n Note2 The IN command cannot be used over Ethernet only RS 232 Note 3 IN command can only be used in thread 0 Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands N A Examples Operator specifies a bit that is to be turned on A Prompt operator for bit to set high IN Enter bit number to turn on N1 SBN1 Set the specified bit high G DONE Print Message EN End Program 90 IQ Digital Input Configuration Full Description The IQ command sets the active level for each of the 16 digital inputs A 0 means current flowing through the opto is logic 1 a 1 means current not flowing through the opto is logic 1 Current flowing through the opto can be seen on the RIO when the green LED turns ON The default state is 0 which means that current not flowing through the opto LED off is logic 1 Arguments
31. the unit has configurable analog ins eg RIO 47x2x Analog input information is displayed in sets of 4 signals at a time until all inputs have been described analog outputs 0 3 bit configuration where bit 12 bits indicates 12 bit resolution of the analog inputs 16 bits indicates 16 bit resolution of the analog inputs configuration range of 0 to 5 indicates the unit has non configurable analog outs eg RIO 47x0x programmable range AQ indicates the unit has configurable analog outs eg RIO 47x2x Analog output information is displayed in sets of 4 signals at a time until all outputs have been described real time clock Presence of the string real time clock indicates power loss persistant real time clock circuitry Arguments N A Operand Usage N A Usage Usage and Default Details While Moving No RIO 80 Controller Usage Default Value Default Format Related Commands Examples ID outputs 0 3 power sourcing outputs outputs 4 7 power sourcing outputs outputs 8 11 sinking outputs outputs 12 15 sinking outputs analog inputs 0 3 16 bits programmable range AQ analog inputs 4 7 16 bits programmable range AQ analog outputs 0 3 16 bits programmable range DQ analog outputs 4 7 16 bits programmable range DQ 81 IF IF conditional statement Full Description The IF command is used in conjunction with an ENDIF command to form an IF conditional st
32. to be cleared from the controller and will result in a timeout Arguments Operand Usage N A Usage Usage and Defalut Details Controller Usage Default Value Default Formula Related Commands RS Reset Examples Example burns in a non default value for KP does a standard reset with the RS command then performs a master reset with R S p 00 P10 N s JUARA p 0 00 R S RA gt KP 6 00 33 R4V Revision Information Full Description The Revision Information command causes the controller to return the firmware revision information Arguments N A Operand Usage N A Usage Usage and Default Details While Moving Related Commands Examples N A 34 Line Continuation Character Full Description ASCII 96 Allows a command in an application program to extend beyond the confines of the maximum line length of 40 characters This is especially useful for code compression long MG statements or multiple conditions in an IF JP or JS statement Note When multiple lines are joined using the line continuation character the first line number is the line number used for any errors For example if lines 5 6 7 are joined and a syntax error occurs on your 7th line the controller will actually report a problem on line 5 Note The lines following the Line Continuation Character will not be displayed in the trace output TR1 A a 123 456 not displaye
33. when downloaded to the controller This comment will be downloaded and takes some execution time PRX 1000 this comment is to the right of the code 134 RI Return from Interrupt Routine Full Description The RI command is used to end the interrupt subroutine beginning with the label ININTn If the program sequencer was interrupted while waiting for a trippoint such as WT RI restores the trippoint on the return to the program RIO clears the trippoint The second field of the RI command either restores or disables the input interrupt feature This field has been added as a special feature of the RIO To avoid returning to the main program on an interrupt use the command ZS to zero the subroutine stack This turns the jump subroutine into a jump only Arguments RI m n where m 0Oorl 0 clears trippoint e g AI trippoint 1 restores trippoint n 0 or no field or 1 0 restores interrupt 1 disables interrupt Operand Usage N A Usage Usage and Default Details While Moving In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands ININT Input interrupt subroutine II Enable input interrupts Examples A II1 0 3 Program label enable interrupt on input 3 AI5 MG DONE EN AI trippoint on input 5 end of program ININT1 Begin interrupt subroutine MG IN 3 INTERRUPTED Print Message CB 3 Set output line 1 RI 1 1 Return to the main program restore AI tri
34. 14 second to output 15 n is an integer in the range of 10 to 20 000 and sets the Frequency or the PWM signal in Hertz see Full Description for resolution information Operands N A Usage Usage and Default Details Related Commands DY PWM output duty cycle PM PWM output enable Examples FO100 200 Set output 14 to 100 Hz and output 15 to 100 Hz DY50 25 Set output 14 to 50 output 15 to 25 PM1 1 Turn PWM mode on for outputs 14 and 15 HS Handle Assignment Switch Full Description The HS command is used to switch the handle assignments between two handles Handles are opened when a connection is established by an external client TCP or UDP or when a handle is assigned explicitly with the IH command Should those assignments need modifications the HS command allows the handles to be reassigned A handle encapsulates the following 4 pieces of information 1 Local IP address same for all handles 2 Remote IP address 3 Local Port 4 Remote Port Handles are used as a pointer to the network socket in commands such as SAh MBh Eh and IHh where h is the handle letter Arguments HSh 1 where h is the first handle of the switch A through H S i is the second handle of the switch A through H S S is used to represent the current handle executing the command Usage Usage and Default Details While Moving Default Value Operand Usage N A Related Commands IH IP Handle Exampl
35. 2 0 N G_RT1 F2 0 N G_RTO F2 0 EN REM The following Subs depend upon line spacing REM Do not add or remove lines PrintD G SUN N EN G MON N EN G TUE N EN G WED N EN G THR N EN G FRI N EN G SAT N EN PrintM G JAN N EN G FEB N EN G MAR N EN G APR N EN G MAY N EN G JUN N EN G JUL N EN G AUG N EN G SEP N EN G OCT N EN G NOV N EN G DEC N EN Example Output TUE MAY 11 2010 14 07 48 142 SA Send Command Full Description SA sends a command from the RIO to another Galil Ethernet controller or another RIO unit Any command can be sent to a slave device and will be interpreted by the controller as a local command Note A wait statement e g WT5 must be inserted between successive calls to SA Arguments SAh arg or SAh arg arg arg arg arg arg arg arg where h is the handle being used to send commands to another Galil Ethernet controller A B or C on the RIO 47xx0 or A B C D E on the RIO 47xx2 arg is a number a controller operand variable mathematical function or string The range for numeric values is 4 bytes of integer 2731 followed by two bytes of fraction 2 147 483 647 9999 The maximum number of characters for a string is 6 characters Strings are identified by quotations Typical usage would have the first argument as a string such as OQ and the subsequent
36. 270 0 0000 MG COS 360 1 0000 FRAC Fractional part Full Description Returns the fractional part of the given number Arguments AFRACT n n is a signed number in the range 2147483648 to 2147483647 Operand Usage N A Usage Usage and Default Detail Related Commands INT n Integer part Examples MG FRAC 1 2 0 2000 MG FRAC 2 4 0 4000 24 IN Read digital input Full Description Returns the value of the given digital input either 0 or 1 Arguments IN n where n is an unsigned integer in the range 0 to 15 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands ANJ n Read analog input OUT n Read digital output SB Set digital output bit CB Clear digital output bit AO set analog output Examples MG IN 1 21 0000 x IN 1 x 21 000 print digital input 1 25 INT Integer part Full Description Returns the integer part of the given number Note that the modulus operator can be implemented with INT see example below Arguments INT n n is a signed number in the range 2147483648 to 2147483647 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands FRAC Fractional part Examples MG INT 1 2 1 0000 MG INT 2 4 2 0000 AUTO modulus example x 10 prepare arguments y 3 JS mod call modulus
37. 5 _OP Output status 0 15 _AFn Analog inputs status 0 7 _AOn Analog outputs 0 7 Arguments RD ml m2 where the arguments are the data type to be captured using the record array feature The order is important Each of the two data types corresponds with the array specified in the RA command Operand Usage _RD contains the address for the next array element for recording Usage Usage and Default Details Controller Usage Default Value Default Format In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands DM Dimension Array RA Record Array RC Record Interval Examples See example for RA command 132 RE Return from Error Routine Full Description The RE command is used to end the error handling subroutine TCPERR An RE at the end of this routine causes a return to the main program Care should be taken to be sure the error condition no longer occurs to avoid re entering the subroutine If the program sequencer was waiting for a trippoint to occur prior to the error interrupt the trippoint condition is preserved on the return to the program if REI is used REO clears the trippoint To avoid returning to the main program on an interrupt use the ZS command to zero the subroutine stack Arguments RE n where n 0 Clears the interrupted trippoint n 1 Restores state of trippoint no argument clears the interrupted trippoint Operand Usage N A
38. 5 go high OR 10 goes low Loop End Program Interrupt subroutine number 2 Print Message Check for reset input 1 to clear interrupt Return to main program 87 Ik Block Ethernet ports Full Description A Galil Ethernet controller simultaneusly operates as a server listening for Ethernet connections from a client and a client able to create connections to a server The IK command blocks clients from connecting to the controller on incoming ports lower than 1000 except for ports 0 23 68 and 502 For SMTP Mail support and the Web Server Feature IK on the RIO also unconditionally exposes ports 25 and 80 For the RIO 471x2 the TIME protocol synchronization on port 37 is unaffected by IK This mechanism employs the RIO as a client connecting to the TIME server Arguments IKn where n 0 allows controller to receive Ethernet packets on any port n 1 blocks controller from receiving Ethernet packets on all ports lower than 1000 except those mentioned in the Full Description above n queries controller for value of IK Operand Usage _IK can not be used as an operand Usage Usage and Default Details Related Commands TH Tell Handles TH Open new Ethernet handle Examples ZIKI Blocks undesirable port communication IKO Allows all Ethernet ports to be used 88 IL Integrator Limit Full Description The IL command limits the effect of the integrator gain in the process control loop to
39. AP address not valid fis Analog patent O EO O 104 105 106 120 121 122 123 124 125 126 127 128 32 150 Command not valid when locked Handle must be UDP not valid for PCI All motors must be in MO for this command not valid for RIO Motor must be in MO not valid for RIO Invalid Password not valid for Econo Optima Optima Passwords not identical nor an for Econo Optima Arguments TC n where n 0 Returns numerical code only n 1 Returns numerical code and human readable message n Returns the error code Operand Usage _TC contains the value of the error code Usage Usage Details While Moving Yes No RIO Default Value Default Format Related Commands Examples GF32 Bad command 2TcC1 Tell error code T Unrecognized command 151 TE Tell Error Full Description This command returns the current error of the analog signal in the control loop For further details see the Process Control section in the User s Manual Arguments TE or TEn where nisAorB No argument will provide the position error for all channels Operand Usage _TEn contains the current position error value for the specified channel Usage Usage and Default Details Controller Usage Default Value po Default Format Default Value 0 In a Program Yes Command Line Yes Related Commands CL Control Loop update rate DB Deadband PS Control Loop Setpoint AF Analog Feedback Select AZ Analgo
40. Description KD designates the derivative constant in the control filter The filter transfer function is D z KP KD z 1 z KIz 2 z 1 The derivative gain outputs a voltage based on the rate of change of the error For further details see the Process Control section in the User s Manual Arguments KD n n or KDm n n is an unsigned numbers in the range 0 to 4095 with a resolution of 1 8 n Returns the value of the derivative constant for the specified channel m A B RIO 47xx2 has 6 control loops KDn n n n n n or m A B C D E F Operand Usage _KDm contains the value of the derivative constant for the specified channel Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands KI Integrator KP Proportional Examples KD 100 200 Specify KD KD Return KD 2100 00 200 00 96 KI Integrator Full Description The KI command sets the integral gain of the control loop It fits in the control equation as follows D z KP KD z 1 z KI z 2 z 1 The integrator term will reduce the error at rest to zero For further details see the Process Control section in the User s Manual Arguments KI n n or KIm n where n is an unsigned numbers in the range 0 to 255 with a resolution of 0 001 n Returns the value for the specified channel m A B RIO 47xx2 has 6 control loops KIn n n n n n or m A B C D E F Operand Usage _KIm contains the value of the integral gain
41. EE RE PEE SRST ISN EEA EEE E TRO ERAS URE EEA EEREN EEE AAEN 41 A O 42 PD A A A celles canal cade 43 PA O 44 E E E A A A 46 A A O e a E A O O O O O 48 A O A A A ATETEA 49 EN 50 O Pane in a coinunecen cesta hei toh r Ms Dale N achat acetal At 52 a A A eaten En A gE ON 53 Gl caer PRA AIR A AI vee VP SW RAIL NN NET 54 e A fet Peet Nas T es noes AAT 56 OD hence A A A A ON 57 ER AA E A A O AA 58 A A A A eatie eer ened 59 A A A NOS 60 TN 61 A A A A O 62 Dra ion E ss 63 A eee esta aie uy eae ett toes ets adacsarite arc ana baie ecigatrenc St 64 DI Re RE A eae ttt mn TE Ee tne niente AT 65 A REIT SERIE AE E ie ee Cen TOR A 67 A aa tele O 68 FL E AE india aan tac A A 69 Nace etic hoe aah T N dine acan ides N EAT 70 O eae ne ne ne vet BTC T E A 72 O A A A 73 A A A seed ceasuuebd 74 A A A E 76 A 77 A A O aches nes te tet Seerh 78 iL DUR Ret te ee te Pan ee a eee E E OE 80 O aa dees 82 11 A IN E IRA Je RT SARNA 84 O A A maa Maced 86 A A E A O E IAN 88 O oat RA RO 89 AAN A AA 90 A A HG TO E OT E OPIN th E HORII ED 91 A A A Mey tality a A ott ace 92 OES Gite ead cata esta eget een e ta era S Dy weno 94 a e TAE RI ot E O T A 96 A ARIAS A AA 97 E A EEE EETA O 98 A A ta 99 a a steak ete al enue cela E A ON 100 OR NN RENAN Du RRR E O 101 The gat N eA E Brahe aah aa O Meh Maca tl laa 102 A A satan E 103 EN REN AA ME Scat tae tase ele tact tesa ce tard es 104 A a ace cc dati tags cece tee Ba a 105 DMI ela NN 108 RT cokes T 109
42. Galil Motion Control HARDWARE COMMAND REFERENCE Edition 5 19 2010 5 33 13 PM svn 210 e Hardware Referenced All RIO e Command Details included for All RIO Galil Motion Control 270 Technology Way Rocklin California 95765 Phone 916 626 0101 Fax 916 626 0102 Email support galilmc com Web www galilmc com Table of Contents Table of Contents A A AAA aaa bales ad tea dea athe 2 A Pc I O allay 6 IADA KO as A ida 7 ENT BRR ia sivas tattle Sa nud E alpcu aaah tess A a esas ENTE EN EEE 8 OM PRR aren a er AD e ae ANNO RR EN OE O ES PEAR E ON APRA EE 9 FOOMIN LAS AN AS E coe TNR 10 TOPE RR ca 11 e a e 12 A A E A E A 13 EEE EEEE EE AE TREE E AE A EE AE EE E SAAR RAM 14 A e a a a a chanel E A E A 15 DAD A E d 16 MACS odo acta 17 DAN UA RS A ERAS ines and eras 18 A A A E E A A E N A 19 NA A A a a e Peon Teana nar irae 20 DALAN 2 AS AS E E ice EE EA AE AA AAA 21 COM A O A 22 A AR A IR tna E e T hae RU A 23 ORC E AA E E E E O 24 O RR rer lor re EIA AE A ROR OE A E OR STOO A E 25 DIN TAS ES anes Nae teen ranean Cacees 26 A e sivas E eaneneies 27 DANI a ad 28 SIN A AO E E cette 29 DIOR A E AEE A do 30 E EE E E AE suuvenastashedacsyuatieransan EE E E A AEEA 31 E A E E EE AE EELE EE EA ERE E 32 E e EEA AAR A E A E A ETA A S 33 RON A AAA Aa 34 A A A hate E AE A pace ten A E AS 35 E PEE N A A 36 E e e RE 37 OAN EA O EE EAEE A EA A A A N 38 DP E TE EE E E AE E A S AE A E E 39 A B a E A a EE aes 40 Fo AA
43. It is helpful for timing to keep the SA command query as short as possible 144 SB Set Bit Full Description The SB command sets a particular output bit setting the output to logic 1 The SB and CB Clear Bit instructions can be used to control the state of output lines The SB command can also be used with modbus devices to toggle off board outputs Note 1 When using Modbus devices the I O points of the modbus devices are calculated using the following formula n HandleNum 1000 Module 1 4 Bitnum 1 HandleNum is the handle specifier from A B or C 1 to 3 Module is the position of the module in the rack from 1 to 16 BitNum is the I O point in the module from 1 to 4 Arguments SB n where n is an integer in the range 0 to 15 decimal Operand Usage N A Usage Usage and Default Details In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands CB Clear Bit OB Output Bit Examples SB 3 Set output line 3 SB 1 Set output line 1 145 SL Single Step Full Description For debugging purposes Single Step through the program after execution has paused at a breakpoint BK Optional argument allows user to specify the number of lines to execute before pausing again The BK command resumes normal program execution Arguments SL n where n is an integer representing the number of lines to execute before pausing again Operand Usage N A Usage U
44. LKJ Bad line 004 EN 00 CMDERR Routine which occurs upon a command error 006 V _ED 00 G An error has occurred n 008 MG In line V F3 0 009 AB 010 ZS0 011 EN YAO BUNE HINT Remember to quit the Edit Mode prior to executing or listing a program 68 ELSE Else function for use with IF conditional statement Full Description The ELSE command is an optional part of an IF conditional statement The ELSE command must occur after an IF command and it has no arguments It allows for the execution of a command only when the argument of the IF command evaluates False If the argument of the IF command evaluates false the controller will skip commands until the ELSE command If the argument for the IF command evaluates true the RIO board will only execute the commands between the IF and ELSE command and then will skip to ENDIF Arguments ELSE Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format In a Program Yes Command Line No Can be Interrogated No Used as an Operand No Related Commands ENDIF End of IF conditional Statement Examples IF IN 1 0 IF conditional statement based on input 1 IF IN 2 0 2nd IF executed if lst IF is true G INPUT 1 AND INPUT 2 ARE INACTIVE Executed if 2nd IF is true ELSE ELSE command for 2nd IF statement G ONLY INPUT 1 IS ACTIVE Executed if 2nd
45. Output Select Examples TE Return all position errors 1 2 Error TEA Sets the variable Error with the channel 1 position error 152 TH Tell Ethernet Handle Full Description This command returns a list of data pertaining to the Galil s Ethernet connection This list begins with the IP address and Ethernet address physical address followed by the status of each handle indicating connection type and IP address Arguments N A Operand Usage N A Usage Usage and Default Details While Moving no RIO Default Value Default Format f Related Commands HS Handle Swap IA IP address IH Internet Handle WH Which Handle Examples TH CONTROLLER IP ADDRESS 10 0 51 82 ETHERNET ADDRESS 10 80 3C 10 01 2F IHA TCP PORT 1010 TO IP ADDRESS 10 0 51 87 PORT 1030 IHB TCP PORT 1020 TO IP ADDRESS 10 0 51 87 PORT 1070 IHC AVAILABLE 153 TI Tell Inputs Full Description This command returns the state of inputs in banks of 8 Response is a decimal number which when converted to binary represents the status of the digital inputs for the specified bank TIO specifies inputs 0 7 bank 0 and TI1 specifies inputs 8 15 bank 1 the response will be a number from 0 to 255 Arguments TI n where nranges from 0 thru 1 Operand Usage _TIn contains the status of the input module for bank n Note The operand can be masked to return only specified bit
46. Pets 5 Dogs 2 Cats 3 Define dimension of arrays pets with 5 elements Dogs with 2 elements Cats with 3 elements DM Tests 1600 Define dimension of array Tests with 1600 elements 63 DQ Change Analog Output Range Full Description The DQ command allows the ability to change the analog output range for individual channels when using the RIO 4712x model only Check the ID command to see if your model supports DQ Arguments DQn m where n 0 through 7 to represent the analog output channel m through 4 to designate the analog output range 1 0 to 5 vdc 2 0 to 10 vde 3 5 to 5 vdc 4 10 to 10 vdc default Operand Usage _DQn contains the present range setting Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands AO Analog Output ID Identify hardware Examples 64 DR Configures I O Data Record Update Rate Full Description The controller creates a QR record and sends it periodically to a UDP Ethernet Handle Arguments DR n m n specifies the data update rate in msec between updates n 0 to turn it off or n must be an integer of at least 2 m specifies the Ethernet handle on which to periodically send the Data Record 0 is handle A 1 is B 2 is C The handle must be UDP not TCP Mapping for DataRecord header UL sample number UW error code UB general status UB analog out 0 counts U analog out 1 counts U analog out 2 counts
47. RIO 47xxx Default Value Default Format 1 0000 Operand Usage _AQn holds the range setting for that axis where n 0 7 Related Commands ANJ n Read Analog Input AQ Analog Input Configuration Examples 44 AQ 2 1 47100 AQ 2 3 AQ 0 3 analog input 1 MG_AQ2 3 0000 Sets Analog input 2 and 3 to be differential inputs on the RIO Specify analog input 2 as 0 5V on the RIO 47120 Specify analog input 0 as 0 5V and the differential input to on the RIO 47120 45 AT At Time Full Description The AT command is a trippoint which is used to hold up execution of the next command until after the specified time has elapsed The time is measured with respect to a defined reference time AT 0 establishes the initial reference AT n specifies n msec from the reference AT n specifies n msec from the reference and establishes a new reference after the elapsed time period Arguments AT n where n is a signed even integer in the range 0 to 2 Billion n 0 defines a reference time at current time n gt 0 specifies a wait time of n msec from the reference time n lt 0 specifies a wait time of n msec from the reference time and re sets the reference time when the trippoint is satisfied AT n is equivalent to AT n AT lt old reference n gt Usage Usage and Default Details While Moving No RIO Default Value O Default Format Operand Usage Related Commands TIME Time Operand WT Wait Exa
48. abel specify the label name following DL The argument may be used with DL to append a file at the end of the controller program in RAM Arguments DLn n no argument Downloads program beginning at line 0 Erases programs in RAM n Label Begins download at line following Label where label may be any valid program label n Begins download at end of program in RAM Operand Usage When used as an operand DL gives the number of available labels The total number of labels is 62 on the RIO 47xx0 On the RIO 47xx2 this is increased to 126 labels Usage Usage and Default Details While Moving In a Program No Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands Examples DL Begin Download SBO Data CB2 Data EN Data control Z End download 62 DM Dimension Full Description The DM command defines a single dimensional array with a name and n total elements The first element of the defined array starts with element number 0 and the last element is at n 1 Arguments DM c n where c is a array name of up to eight alphanumeric characters starting with an alphabetic character n is the number of array elements DM returns the number of array elements available Operand Usage _DM contains the available array space Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands DA Deallocate Array Examples DM
49. an gt greater than equals lt less than or equal gt greater than or equal lt gt not equals These are used in conjunction with IF JP JS 8 and to perform conditional jumps The result of a comparison expression can also be printed with MG or assigned to a variable Arguments n lt m or n gt m or n m or n lt m or n gt m or n lt gt m where n and m are signed numbers in the range 2147483648 to 2147483647 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands Parentheses IF If statement JP Jump JS Jump subroutine Examples IF x gt 2 amp y 4 MG true ENDIF x must be greater than 2 and y equal to 4 for the message to print 37 Equals Assignment Operator Full Description The assignment operator is used for three reasons 1 to define and initialize a variable x 0 before it is used 2 to assign a new value to a variable x 5 3 to print a variable or array element x which is equivalent to MG x MG is the preferred method of printing Arguments mmmmmmmm n where mmmmmmmm is a variable name and n is a signed number in the range 2147483648 to 2147483647 Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands MG Print Message Examples x 5 x define and initialize x to 5 5 0000 MG x print x t
50. and Usage _EO contains the state of the echo 0 is off 1 is on Related Commands Examples EO 0 Turns echo off EO 1 Turns echo on FQ PWM output frequency Full Description FQ sets the PWM frequency of the RIO 471xx configurable PWM outputs 14 and 15 The PWM option is necessary in order to obtain the full frequency range for the PWM output See the RIO user manual for more information The FQ command should be set to a known value before the PWM output is enabled The resolution of the PWM output is defined by RIO 471x2 FQ setting of 312 to 20000 the resolution is defined by the following equations scale RND 80000 FQ frequency 80000 scale frequency is accurate to 0 1 Hz FQ setting of 10 to 311 the resolution is frequency FQ frequency is accurate to 1 Hz For example FQ 19000 scale RND 80000 19000 4 frequency 80000 4 20000 Hz FQ 20000 scale RND 80000 20000 4 frequency 80000 4 20000 Hz RIO 471x0 FQ setting of 235 to 20000 the resolution is defined by the following equations scale RND 60000 FQ frequency 60000 scale frequency is accurate to 0 1 Hz FQ setting of 10 to 234 frequency FQ frequency is accurate to 1 Hz For example FQ 19000 scale RND 60000 19000 3 frequency 60000 3 20000 Hz FQ 20000 scale RND 60000 20000 3 frequency 60000 3 20000 Hz Arguments FQ n n Where First argument corresponds to output
51. arguments as the arguments to the command Example SAA KD 20 40 would send the command KD 20 40 Operand Usage _SAhn gives the value of the response to the command sent with an SA command The h value represents the handle A B or C and the n value represents the specific field returned from typically a multi channel controller The n value gets defaulted to 1 if unspecified in the operand If a specific field is not used by the controller e g fifth field on a four axes controller the operand will be 2731 Response from another RIO board has usually just one field therefore the n value does not need to be included in the operand Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands IH Set Internet Handles Examples SAA KI 1 2 Sends the command to handle A e g a controller KI 1 2 WI5 SAA TE Sends the command to handle A controller TE MG _SAA Display the content of the operand SAA first response to TE command 132 MG _SAA2 Display the content of the operand SAA 2nd response to TE command 12 Note The SA command does not wait for a response from the slave controller before continuing code execution Therefore a WTxx is required between two SA 143 commands or between an SA command and querying the response using _SAhn There is a 38 character maximum string length for the SA command
52. atement The arguments consist of one or more conditional statements and each condition must be enclosed with parenthesis If the conditional statement s evaluates true the command interpreter will continue executing commands which follow the IF command If the conditional statement evaluates false the controller will ignore commands until the associated ENDIF command OR an ELSE command occurs in the program Each condition must be placed in parenthesis for proper evaluation by the controller Example IF var0 1 amp varl 2 valid IF statement MG GOOD ENDIF IF var0 l varl 2 invalid IF statement MG BAD ENDIF Arguments IF condition where Conditions are tested with the following logical operators lt less than or equal to gt greater than equal to lt less than or equal to gt greater than or equal to lt gt not equal Note 1 Bit wise operators and amp can be used to evaluate multiple conditions Note 2 A true condition 1 and an false condition 0 Usage Usage and Default Details While Moving Operand Usage Related Commands ELSE Optional command to be used only after IF command ENDIF End of IF conditional Statement JS Jump to subroutine JP Jump to label 82 Examples input IF IN 1 0 IF conditional statement based on input 1 MG Input 1 is Low Message to b xecuted if IF statement is true ENDIF End of IF co
53. ault Details Controller Usage Default Value null string Default Format Related Commands lt control gt L lt control gt K Lock Unlock ED Edit program UL Upload program LS List program TR Trace program Examples PWtest test Set password to test L K test 1 Lock the program ED Attempt to edit program 124 QD Download Array Full Description The QD command transfers array data from the host computer to the RIO QD array start end requires that the array name be specified along with the first element of the array and last element of the array The array elements can be separated by a comma or by lt CR gt lt LF gt The downloaded array is terminated by al Arguments QD array start end where array is a valid array name start is the first element of the array default 0 end is the last element of the array default last element Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format N A Position Format for 18x2 In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands QU Upload array Examples Using Galil terminal software the command can be used in the following manner l Define the array with the DM command 2 Set the timeout to 0 this disengages the timeout oe Send the command QD 3a Use the send file command to send the data file OR 3b Enter data manual
54. be returned by the controller The default state of the board is to disable the CW command However the terminal software may enable the CW command for internal usage If the board is reset while the Galil software is running the CW command could be reset to the default value which creates difficulty for the software It may be necessary to re enable the CW command The CW command status can be stored in EEPROM 58 DA Deallocate the Variables amp Arrays Full Description The DA command frees the array and or variable memory space In this command more than one array or variable can be specified for memory de allocation Different arrays and variables are separated by comma when specified in one command The argument deallocates all the variables and 0 deallocates all the arrays Arguments DA c d etc where c Defined array name d Defined variable name Deallocates all the variables Deallocates all the arrays DA Returns the number of arrays available Operand Usage _DA contains the total number of arrays available Usage Usage and Default Details While Moving Controller Usage Related Commands DM Dimension Array Examples Cars and Salesmen are arrays and Total is a variable DM Cars 40 Salesmen 50 Dimension 2 arrays Total 70 Assign 70 to the variable Total DA Cars 0 Salesmen 0 Total Deallocate the 2 arrays amp variable DA 0 Deallocate all
55. d If an RS 232 connection is used to assign the IP address DH must be set to 0 DH 0 prior to issuing the IA command Arguments IA ip0 ip1 ip2 ip3 or IA n or IA lt t where ip0 ipl ip2 ip3 are 1 byte numbers separated by commas and represent the individual fields of the IP address n is the IP address for the controller which is specified as an integer representing the signed 32 bit number two s complement gt u specifies the multicast IP address where u is an integer between 0 and 63 lt t specifies the time in update samples between TCP retries IA will return the IP address of the RIO board DHCP must be disabled DHO in order to set the IP address manually with the IA command Operand Usage _TAO contains the IP address representing a 32 bit signed number Two s complement _IA1 contains the value for t retry time _TA2 contains the number of available handles _IA3 contains the number of the handle using this operand where the number is 0 2 for RIO 47xx0 and 0 4 for RIO 47xx2 0 represents handle A 1 for handle B 2 for C _TA4 contains the handle that lost communication last Contains 1 on reset to indicate no handles lost _TAS returns autonegotiation Ethernet speed Returns 10 for 10 Base T and returns 100 for 100 Base T it will return 1 if there is no physical link Usage Usage and Default Details Controller Usage Ethernet Controllers Default Value n 0 t 250 Default Format Related Commands IH I
56. d is used for formatting the values returned from interrogation commands or interrogation of variables and arrays By enabling the LZ function all leading zeros of returned values will be removed Arguments LZ n where n is 1 to remove leading zeros 0 to disabled the leading zero removal LZ Returns the state of the LZ function Note Default value is 1 Operand Usage _LZ contains the state of the LZ command Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand Yes Related Commands Examples TB Tell status 001 LZ 1 Inhibit leading zeros TB Tell status zI 103 MA Email Server IP Address Full Description The MA command sets the SMTP email server ip address The default address is 0 0 0 0 which yields no email transactions Arguments MA n n n n where n is a value from 0 to 254 for each field of the IP address Operand Usage _MA Usage Usage and Default Details While Moving Related Commands MD Set Mail Destination Address MS Set Mail Source Address Examples 104 MB Modbus Full Description The MB command is used to communicate with I O devices using the first two levels of the Modbus protocol The format of the command varies depending on each function code The function code 1 designates that the first level of Modbus is used creates raw packets and receives raw data The other codes
57. d numbers Operand Usage _NO returns a bit field indicating which threads are running For example 0 means no threads are running 1 means only thread 0 is running 3 means threads 0 and 1 are running and 255 means all 8 threads are running Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands Examples A Program A O No Operation NO This Program No Operation Does Absolutely No Operation Nothing No Operation EN End of Program 117 OB Output Bit Full Description The OB n logical expression command defines output bit n 0 through 15 as either 0 or 1 depending on the result from the logical expression Any non zero value of the expression results in a one on the output Arguments OB n expression where nis 0 through 15 denoting output bit expression is any valid logical expression variable or array element Operand Usage N A Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No RELATED COMMAND CB Clear Bit SB Set Bit Related Commands Examples OB 1 POS 1 If POS 1 is non zero Bit 1 is high If POS 1 is zero Bit 1 is low OB 2 IN 5 amp IN 6 If Input 5 and Input 6 are both high then Output 2 is set high OB 3 COUNT 1 If the element 1 in the array is zero clear bit 3 otherwise
58. d with TR1 output EN Arguments none Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands MG Print Message Examples IF var100 1000 var101 50 MG GO EL SE MG STOP ENDIF 35 1 Math Operators Full Description The addition subtraction multiplication division and modulus Accelera only operators are binary operators they take two arguments and return one value used to perform mathematical operations on variables constants and operands Mathmatical operations are calculated left to right rather than multiplication and division calculations performed prior to addition and subraction Example 1 2 3 9 not 7 It is recommended that parenthesis be used when more than one mathmatical operation is combined in one command Example var 10 30 60 30 evaluates as 302 var 10 30 60 30 evalutes as 12 Arguments n m or n m or n m or n m or n m where n and m are signed numbers in the range 2147483648 to 2147483647 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands Parenthesis Examples 2x 1 2 3 7 2 assign 1 to x MG 40 6 integer remainder of 40 divided by 6 4 0000 36 y gt lt gt lt gt Comparison Operators Full Description The comparison operators are as follows lt less th
59. dual usage The CW command will return the copyright information when the argument n is 0 Otherwise the CW command is used as a communications enhancement for use by the Galil terminal software programs When turned on the communication enhancement from the command sets the MSB of unsolicited returned ASCII characters to 1 Unsolicited ASCII characters are characters that are returned from a program running on the controller This command does not affect solicited characters which are characters that are returned as a response to a command sent from a host PC Arguments CW n m where n is a number either 0 1 or 2 0 or Causes the controller to return the copyright information 1 Causes the controller to set the MSB of unsolicited returned characters to 1 2 Causes the controller to not set the MSB of unsolicited characters m is 0 or 1 optional 0 Causes the controller to pause program execution when hardware handshaking disables character transmissions 1 Causes the controller to continue program execution when hardware handshake disables character transmissions output characters will be lost Operand Usage _CW contains the value of the data adjustment bit 1 on 2 off Usage Usage and Default Details Controller Usage Default Value Default Format In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand Yes Related Commands Examples Note The CW command can cause garbled characters to
60. e AO x Report back analog output value Examples A01 1 324 Outputs 1 324 Volts on Channel 1 43 AQ Analog Input Configuration Full Description The Analog Configuration AQ command is used to set the type of analog input single ended default or differential For the RIO 4712x or RIO 472xx with 10V analog inputs The AQ command also sets the range of the analog inputs There are 4 different ranges that each analog input may be assigned Setting a negative range for inputs 0 2 4 or 6 configures those inputs as differential inputs with the compliment input 1 3 5 and 7 respectively Note Default resolution for analog inputs is 12bits The RIO 4712x 16bit and RIO 472xx 16bit have 16bit resolution Arguments For the RIO 47100 or RIO 472xx AQ n m where n is an even integer from 0 6 that represents the analog input channel m 0 default single ended inputs m differential inputs next odd channel is consumed For the RIO 4712x or RIO 472xx with 10V analog inputs AQ n m where n is an integer from 0 7 that represents the analog input channel m is an integer from 1 4 that designates the analog range m Analog Range 1 5V 2 10V default for RIO 4712x 3 0 5V 4 0 10V Setting a negative range for inputs 0 2 4 or 6 configures those inputs as differential inputs with the compliment input 1 3 5 and 7 respectively Usage Usage and Default Details Controller Usage DMC 40x0 DMC 21x3
61. ell Handles Examples WH Request handle identification THB Command executed in handle B WH Request handle identification RS232 Command executed in RS232 port 160 WT Wait Full Description The WT command is a trippoint used to time events When this command is executed the controller will wait for the number of miliseconds specified before executing the next command Arguments WT n where n is an unsigned even number in the range 0 to 2000000000 2 Billion Operand Usage N A Usage Usage and Default Details While Moving No RIO In A Program Default Value f Default Format Related Commands AT At Time TIME Time Operand Examples REM 2 seconds after input 1 goes low turn on output 1 for 3 seconds main AI 1 wait for input 1 to go low WT 2000 wait 2 sec SB 1 set output 1 WT 3000 wait 3 sec CB 1 clear output 1 JP main start over again 161 XQ Execute Program Full Description The XQ command begins execution of a program residing in the program memory of the RIO board Execution will start at the label or line number specified Up to 4 programs may be executed simultaneously to perform multitasking Arguments XQ A n XQm n where A is a program name of up to seven characters m is a line number n is the thread number 0 thru 3 for multitasking NOTE The arguments for the command XQ are optional If no arguments are given the first program in mem
62. endant on the RIO hardware configuration See the AQ command for the Analog Input range Note The AF and AZ commands must be set before the use of PS Arguments PS n n or PSm n n is a signed value from OV to 5v on the RIO 4710x or within the DQ range on the RIO 4712x n returns the control set point Resolution for both is 0 0001 m A B RIO 47xx2 has 6 control loops PSn n n n n n or m A B C D E F Operand Usage _PSm returns setpoint for the specified axis Usage Usage and Default Details While Moving Controller Usage Default Value LO Default Value 0 In a Program Yes Default Format 1 4 Command Line Yes Related Commands Examples CL AF 25 0 Y 25msec update rate analog input 0 as feedback analog output 0 as control proportional gain to 1 derivative gain to 10 integral gain to 0 5 deadband of 0 1V set point at 1 8V 123 PW Password Full Description The password can be set with the command PW password password where the password can be up to 8 alphanumeric characters The default value after master reset is a null string The password can only be changed when the controller is in the unlocked state L K The password is burnable but cannot be interrogated If you forget the password you must master reset the controller to gain access Arguments PW n n where n is a string from 0 to 8 characters in length Operand Usage N A Usage Usage and Def
63. ent comment Examples SB1 WT500 CB1 multiple commands separated by semicolons with a comment High High priority thread executes twice as fast as a a3 1 b b 1l JP High Low Low when run in parallel Care bal daard 4 01 JP Low 15 ABS Absolute value Full Description Takes the absolute value of the given number Returns the value if positive and returns 1 times the value if negative Arguments ABS n where n is a signed number in the range 2147483647 to 2147483647 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands All math operators Examples MG ABS 2147483647 2147483647 0000 16 ACOS Inverse cosine Full Description Returns in degrees the arc cosine of the given number Arguments ACOS n where n is a signed number in the range 1 to 1 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands ASIN Arc sine SIN sine ATAN Arc tangent COS Cosine TAN Tangent Examples MG ACOS 1 180 0000 MG ACOS 0 90 0000 MG ACOS 1 0 0001 17 AN Analog Input Query Full Description Returns the value of the given analog input in volts Arguments ANJ n where n is the input number assigned to a particular analog input pin 0 7 Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Defa
64. ent using a logical operator The logical operators are lt less than gt greater than equal to lt less than or equal to gt greater than or equal to lt gt not equal to Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands JS Jump to Subroutine IF If conditional statement ELSE Else function for use with IF conditional statement ENDIF End of IF conditional statement Examples JP POS1 V1 lt 5 Jump to label POS1 if variable V1 is less than 5 JP A V7 V8 0 Jump to A if V7 times V8 equals 0 92 JP B IN 1 9 Jump to B if input 1 1 JP C Jump to C unconditionally Hint JP is similar to an IF THEN command Text to the right of the comma is the condition that must be met for a jump to occur The destination is the specified label before the comma 93 JS Jump to Subroutine Full Description The JS command will change the sequential order of execution of commands in a program If the jump is taken program execution will continue at the line specified by the destination parameter which can be either a line number or label The line number of the JS command is saved and after the next EN command is encountered End of subroutine program execution will continue with the instruction following the JS command There can be a JS command within a subroutine up to 16 deep Multiple conditions can be u
65. er between 0 and 3 This argument indicates the thread number in which the ININTn subroutine is going to be executed The specified thread needs to be running when the interrupt occurs otherwise the ININTn subroutine will not be executed Upon interrupt the existing thread m will be interrupted to allow the execution of the interrupt subroutine Upon completion of the interrupt the main program in thread m will once again be enabled from the point at which the interrupt occurred condition can consist of any number of inputs using the amp operator between each input A positive input number means the condition is for that input to go high and a negative input number for that input to go low type determines the logical operator to be employed in the condition statment when the amp sign forms a conjunction of inputs If type is omitted or is 0 the input statements must all be true to trigger ININTn If type is 1 then any true input statment will trigger ININTn Operand Usage N A Usage Usage and Default Details Command Line In a Program Yes Command Line No Can be Interrogated No Used as an Operand No Related Commands 86 RI Return from Interrupt ININTn Interrupt Subroutine AI Trippoint for input Examples A II 2 0 3858 10 1 LOOP JP LOOP N ININT2 G INTERRUPT CLEAR JP CLEAR IN 1 0 RI zal Program A Specify interrupt 2 on main thread when inputs 3 OR
66. es HSC D Connection for handle C is assigned to handle D Connection for handle D is assigned to handle C HSS E Executing handle connection is assigned to handle E Connection for handle E is assigned to executing handle 76 HX Halt Execution Full Description The HX command halts the execution of any of the 4 programs that may be running independently in multitasking The parameter n specifies the thread to be halted Arguments HX n where n is 0 to 3 to indicate the 4 threads Operand Usage When used as an operand HX n contains the running status of thread n with 0 Thread not running 1 Thread is running 2 Thread has paused at trippoint Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands XQ Execute program Examples XQ A Execute program A thread zero XQ B 1 Execute program B thread one HXO Halt thread zero HX1 Halt thread one T1 IA IP Address Full Description The IA command assigns the controller with an IP address The IA command may also be used to specify the time out value This is only applicable when using the TCP IP protocol The IA command can only be used via RS 232 Since it assigns an IP address to the controller communication with the controller via internet cannot be accomplished until after the address has been assigned The RIO is DHCP enable
67. eturned from the server JS print call the time print subroutine EN print G RT2 F2 0 N print the current hours GORTE E20 ppt SINE print the current minutes G _RTO F2 0 print the current seconds EN Example output SCF93127A Tei dTa E Note When the IH command is given the controller initializes an ARP on the 85 II Input Interrupt Full Description This newly formatted II command enables the interrupt function for the specified inputs This function can trigger one of four input interrupt subroutines ININTn when the controller sees that the conditional statement is satisfied When the condition is satisfied the program will jump to the subroutine with label ININTn where n ranges from 0 to 3 This subroutine will be executed in thread m where m is between 0 main and 3 causing any trippoint set in that thread to be cleared The cleared trippoint can be re enabled by the proper termination of the interrupt subroutine using RI The RI command is used to return from the ININTn routines To avoid returning to the program on an interrupt use the command ZS to zero the subroutine stack and use the II command to reset the interrupt Note An application program must be running on the controller for the interrupt function to work Arguments II n m condition type n is an integer between 0 and 3 This number specifies the ININTn subroutine to be executed when the interrupt occurs m is an integ
68. f no parameter is specified it will start with line 0 The listing will end with the line pointed to by the second parameter again either a line number or label If no parameter is specified the listing will go to the last line of the program Arguments LS n m where n m are valid numbers from 0 to 199 or labels n is the first line to be listed m is the last Operand Usage N A Usage Usage and Default Details Controller Usage Default Value 0 Last Line for DMC Default Forma In a Program No Command Line Yes Can be Interrogated No Used as an Operand No Related Commands LA List Arrays LL List Labels LV List Variables Examples LS A 6 List program starting at A through line 6 002 A 003 MG Program A 004 COUNT 1 005 SB2 006 WT 2000 101 LV List Variables Full Description The LV command returns a listing of all of the program variables in memory max number of variables is 126 on the RIO 47xx0 and 254 on the RIO 47xx2 The listing will be in alphabetical order Arguments None Operand Usage N A Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand No Related Commands LL List Labels Examples LV Interrogation Command APPLE 60 0000 RIO board returns a list of 3 variables BOY 25 0000 ZEBRA 37 0000 102 LZ Inhibit leading zeros Full Description The LZ comman
69. for the specified channel Usage Usage and Default Details Value aviat Default Value A A Default Format 4 0 for 18x2 8 21x3 4 4 for 18x6 40x0 amp RIO Default Value 0 In a Program Yes Default Format 4 4 Command Line Yes Related Commands KP Proportional Constant KD Derivative Constant IL Integrator Limit Examples KI 12 14 Specify A B channel integral gain KI 7 Specify A channel only KI 8 Specify B channel only KI eye Return A B Sd 14 KI values 97 KP Proportional Constant Full Description KP designates the proportional constant in the controller filter The filter transfer function is D z KP KD z 1 z KI z 2 z 1 The proportianal gain outputs a voltage proportional to the amount of error For further details see the Process Control section in the User s Manual Arguments KP n n or KPm n where n is an unsigned numbers in the range 0 to 1023 875 with a resolution of 1 8 n Returns the value of the proportional constant for the specified channel m A B RIO 47xx2 has 6 control loops KPn n n n n n or m A B C D E F Operand Usage _KPm contains the value of the proportional constant for the specified channel Usage Usage and Default Details Controller Usage Default Value 6 Default Format Related Commands KD Derivative Constant KI Integrator Constant IL Integrator Limit Examples KP 12 14 Specify A B channel proportional gain KP 7 Specify A channel onl
70. g and are often used to implement subroutines or loops Labels are divided into a user defined b automatic subroutines User defined labels can be printed with LL and the number of labels left available can be queried with MG _DL The automatic subroutines include CMDERR LIMSWI POSERR ININT AUTO AUTOERR and MCTIME no RIO A label can only be defined at the beginning of a new line There is a maximum of 62 labels available on the RIO 47xx0 There is a maximum of 126 labels available on the RIO 47xx2 Arguments nnnnnnn where nnnnnnn is a label name up to seven characters Uppercase or lowercase characters are valid Operand Usage N A Usage Usage and Default Details Related Commands LL List labels _DL Labels available JP Jump statement JS Jump subroutine Examples A simpl xample of iteration The loop will run 10 times i 0 Create a counter Loop Label i i 1 Increment counter JP Loop i lt 10 spin in Loop until i gt 10 EN End the subroutine or thread AUTO Subroutine to run automatically upon power up Full Description AUTO denotes code to run automatically when power is applied to the controller or after the controller is reset When no host software is used with the controller AUTO and the BP command are required to run an application program on the controller Upon controller startup application code will automatically begin running in thread 0 at AUTO U
71. g the data record Arguments ZDn where n can be a number RIO board operand variable mathematical function or string The range for numeric values is from 2 147 483 648 to 2 147 483 647 The maximum number of characters for a string is 4 characters Strings are identified by quotations NOTE If n is a the decimal value of ZD will be returned Operand Usage _ZD contains the decimal value of the user variable Usage Usage and Default Details Default Value Default Formar In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand Yes Related Commands ZC Set first user variable Examples ZD INPT Sets the second user variable to the string INPT 164 ZS Zero Subroutine Stack Full Description The ZS command is only valid in an application program and is used to avoid returning from an interrupt either input or error ZS alone returns the stack to its original condition ZS1 adjusts the stack to eliminate one return This turns the jump to subroutine into a jump Do not use RI Return from Interrupt when using ZS To re enable interrupts you must use II command again The status of the stack can be interrogated with the operand _ZSn see operand usage below Arguments ZS n where n 0 Returns stack to original condition n 1 Eliminates one return on stack Operand Usage _ZSn contains the stack level for the specified thread where n 0 thru 3 The respon
72. ge Usage and Default Details While Moving No RIO Related Commands ASIN n Arc sine COS n Cosine QATANT n Arc tangent ACOS n Arc cosine TAN n Tangent Examples MG SIN O 0 0000 MG SIN 90 1 0000 MG SIN 180 0 0000 MG SIN 270 1 0000 MG SIN 360 0 0000 SQR Square Root Full Description Takes the square root of the given number If the number is negative the absolute value is taken first Arguments ASQR n where n is a signed number in the range 2147483648 to 2147483647 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands ABS n Absolute value Examples MG SQR 2 1 4142 MG SOR 2 1 4142 30 Square Brackets Array Index Operator Full Description The square brackets are used to denote the array index for an array or to denote an array name They are also used to designate the argument to a function such as ABS n Arguments mmmmmmmm n where mmmmmmmm is the array name n is the array index and is an integer between 0 and 399 for the RIO 47xx0 0 999 on the RIO 47xx2 Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands DM Dimension Array QU Print Upload Array Examples DM A 50 define a 50 element array A 0 3 set first element to 3 MG A O0 print element 0 31
73. ger Modbus registers 1xxx OR as a 32 bit floating point number Modbus registers 2xxx Reading the registers by a Modbus master is always supported but writing to the registers is not enabled until ME1 is set on the RIO Writing is disabled by default to prevent unintentional writes to user arrays Once enabled the entire array table can be written remotely These writes can span across dimensioned user arrays It is the user s responsibility to partition the array table and to read write remotely to the correct location When using multiple array names the array table is partitioned alphabetically For example a partioned array of Grape 600 and Orange 200 would place the first 600 registers in Grape and the next 200 registers in Orange The last 200 elements would be inaccesible from RIO embedded code If the user then dimensioned the array Apple 200 the register mapping would change The first 200 registers would read write from Apple the next 600 from Grape and finally the last 200 from Orange For simplicity Galil recommends that a single contiguous array be dimensioned with the array name A The dimension of the array A should be 1000 on the 471x2 and 400 on the 471x0 and 47200 Modbus Register Map to Galil Array A Modbus Registers 1000 1xxx 2000 2xxx Register range for RIO 471x2 1000 1999 xxx 999 2000 2999 xxx 999 Register range for RIO 471x0 and 1000 1399 xxx 399 2000 2399 xxx 399 Available M
74. gisters m is the address of the first Register n is the quantity of registers 105 array is the name of the array that will store the resulting register data 2 byte per element MBh addr 4 m n array where h is the handle letter addr is the unit ID 4 is the function code 4 Read Input Registers m is the address of the first Register n is the quantity of registers array is the name of the array that will store the resulting register data 2 byte per element MBh addr 5 m n array where h is the handle letter addr is the unit ID 5 is the function code 5 Force Single Coil m is the address of the coil n is a value of 0 or 1 to turn the coil off or on MBh addr 6 m n where h is the handle letter addr is the unit ID 6 is the function code 6 Preset Single Register m is register address nis a 16 bit value MBh addr 7 m n array where h is the handle letter addr is the unit ID 7 is the function code 7 Read Exception Status m is the address of the first Register n is the quantity of registers array is the name of the array where the response will be stored in the first element MBhz addr 15 m n array where h is the handle letter addr is the unit ID 15 is the function code 15 Write Multiple Coils m is the address of the first register n is the quantity of registers array is the name of the array that will store the desired register data 2 byte per element MBh addr 16
75. information see section on Bitwise operations Usage Usage and Default Details Controller Usage Default Value Default Format In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand Yes Related Commands Examples TIT Tell input state on bank 1 8 Bit 3 on slot 1 is high others low TIO 0 All inputs on bank 0 low Input TI1 Sets the variable Input with the TIl value Input 8 0000 154 TIME Time Operand Keyword Full Description The TIME operand contains the value of the intenal free running real time clock The operand TIME will increase by 1 count every millisecond The clock is reset to 0 with a standard reset or a master reset The keyword TIME does not require an underscore _ as with the other operands Arguments Operand Usage N A Usage Usage and Default Details While Moving No RIO Controller Usage __ Detit value __ Default Formar In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands Examples MG TIME Display the value of the internal clock T1 TIME Sets the variable T1 with the TIME value 155 TR Trace Full Description The TR command causes each instruction in a program to be sent out the communications port prior to execution TR1 enables this function and TRO disables it The trace command is useful in debugging programs Note The lines following the Line Cont
76. inuation Character will not be displayed in the trace output A a 123 456 not displayed with TR1 output EN Arguments TR n where n Oorl 0 disables function 1 enables function Usage In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Operand Usage Related Commands Line Continuation Character Examples 156 TZ Tell I O Configuration Full Description This command returns a list of information pertaining to the status of the RIO s I O On each line the information starts with the I O block the corresponding I O number range the configuration as inputs or outputs and the values 255 for all 8 output bits high etc Arguments TZ Operand Usage N A Usage Usage and Default Details In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand No RELATED COMMAND TH Tell Ethernet Handle TQ Tell Thread Execution Related Commands TI Tell Inputs SB CB Set Clear output bits OP Output port CO Configure I O Examples TS Block 0 7 0 Inputs value 255 1111 1111 Block 1 15 8 Inputs value 255 1111 1111 Block 0 7 0 Outputs value 0 0000 0000 Block 1 15 8 Outputs value 0 0000_0000 Analog Inputs 7 0 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 Analog Outputs 7 0 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 157 UL Upload Full Description The UL command transfers data from
77. ks Bits Description m 0 0 7 General Outputs bank 0 n 1 8 15 General Outputs bank 1 m or n returns the value of the argument Operand Usage _OPO contains the value of the first argument m _OP1 contains the value of the second argument n Usage Usage and Default Details While Moving No RIO Default Value O Related Commands SB Binary EA Set output bit CB Clear output bit OB Output Byte Examples OP 0 Clear Output Port all bits OP 85 Set outputs 1 3 8 clear the others MG _OPO Returns the first parameter m MG _OP1 Returns the second parameter a 120 PC Pulse Counter Enable Full Description Enables the use of a pulse counter on input DI3 When turned on input DI3 will not be available as a general purpose input accessible with IF or IN When the HC high speed counter option is ordered with the RIO DI2 will be the differential input for the counter input DI2 will not be available as a general purpose input See the HC section in the RIO 47xxx User Manual for more information Arguments PCn where n 0 default input DI3 is a general purpose input n 1 sets input DI3 to be a rising edge pulse counter also clears the pulse counter n 1 sets input DI3 to be a falling edge pulse counter also clears the pulse counter n returns the status of the pulse counter 0 if disabled 1 if enabled Operand Usage _PC contains the number of pulses counted PC will return an integer i
78. l Status Byte Full Description The TB command returns status information from the RIO as a decimal number Each bit of the status byte denotes the following condition when the bit is set high BIT STATUS Bit 7 Executing program Bit 6 N A Bit 5 N A Bit 4 N A Bit 3 Input interrupt enabled in thread 0 Bit 2 Executing input interrupt routine in thread 0 Bit 1 0 Reserved Bit 0 Echo on Arguments None Operand Usage _TB contains the status byte Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated Yes Related Commands Examples TB Tell status information from the RIO board 129 Executing program and echo on 2 7 2 0 128 1 129 148 TC Tell Error Code Full Description The TC command returns a number between 1 and 255 This number is a code that reflects why a command was not accepted by the controller This command is useful when the controller halts execution of a program or when the response to a command is a question mark After TC has been read the error code is set to zero TC1 will return the error code along with a human readable description of the code Tell Code List not valid for RIO not valid for RIO not valid for RIO IP incorrect sign during position move or IP given during forced not valid for RIO deceleration not valid for RIO not valid for RIO not valid for RIO not valid for RIO not valid for RIO not valid fo
79. lts of the QR command since the results are in binary format Examples 127 QU Upload Array Full Description The QU command transfers array data from the RIO to a host computer QU requires that the array name be specified along with the first element of the array and last element of the array The uploaded array will be followed by a lt control gt Z as an end of text marker Arguments QU array start end delim where array is a valid array name start is the first element of the array default 0 end is the last element of the array default last element delim specifies the character used to delimit the array elements If delim is 1 then the array elements will be separated by a comma Otherwise the elements will be separated by a carriage return Operand Usage N A Usage Usage and Default Details Deta Value JO In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands QD Download array Examples 128 QZ Return Data Record information Full Description The QZ command is an interrogation command that returns information regarding the Data Record The RIO board s response to this command will be the return of 4 integers separated by commas The first field returns the number of control loops The second field returns the number of bytes in the general data block of the QR record This is always 4 for the RIO Third field returns the number of byte
80. ly from the terminal End the data entry with the character 4 Set the timeout back to a positive number 125 QR I O Data Record Full Description The QR command causes the RIO to return a record of information regarding the I O status back to the host PC This status information includes 4 bytes of header information and specific blocks of I O information The details of the status information are described in the user manual Arguments QR Mapping for DataRecord header UL sample number UW error code UB general status UB analog out 0 counts U analog out 1 counts U analog out 2 counts U analog out 3 counts U analog out 4 counts U analog out 5 counts U analog out 6 counts U analog out 7 counts U analog in 0 counts U analog in 1 counts U analog in 2 counts U analog in 3 counts U analog in 4 counts U analog in 5 counts U analog in 6 counts U analog in 7 counts U output state UW input state UW pulse count UL ZC data SL ZD data SL Operand Usage N A Usage Usage and Default Details Controller Usage pe Default Value Default Format Related Commands QZ Return DMA Data Record information Note The Galil windows terminal will not display the results of the QR command since the results are in binary format W W W W W W W W EEEE 126 QZ Return Data Record information Note The Galil windows terminal will not display the resu
81. mmand execution In this case the command interpreter may not execute an ENDIF command Arguments N A Usage Usage and Default Details Controller Usage Default Value Default Format Operand Usage Related Commands IF Command to begin IF conditional statement ELSE Optional command to be used only after IF command JP Jump command JS Jump to subroutine command Examples A IF IN 1 0 IF IN 2 0 ELSE ENDIF ELSE G ONLY INPUT 2 IS ACTIV NDIF N Hw MG INPUT 1 AND INPUT 2 ARE MG ONLY INPUT 1 IS ACTIV ACTIV GI IF conditional statement based on input 1 2nd IF conditional statement executed if lst IF conditional true Message to b xecuted if 2nd IF conditional is true ELSE command for 2nd IF conditional statement ssage to b xecuted if 2nd IF conditional is false End of 2nd conditional statement ELSE command for lst IF conditional statement ssage to b xecuted if 1st IF conditional statement is false End of 1st conditional statement 72 EO Echo Full Description The EO command turns the echo on or off If the echo is off characters input over the bus will not be echoed back Serial only no Ethernet Arguments EO n where n 0 0 turns echo off n 1 1 turns echo on Usage Usage and Default Details Default Vale PEDO o Oper
82. more time than the default timeout period The timeout can be changed in the Galil software This warning does not affect the operation of the board or software Examples 52 CB Clear Bit Full Description The CB command clears a particular output bit setting the output to logic 0 The CB and SB Set Bit instructions can be used to control the state of output lines The CB command can also be used with modbus devices to toggle off board outputs Arguments CB n where n is an integer corresponding to a specific output to be cleared 0 15 for on board outputs When using Modbus devices the I O points of the Modbus devices are calculated using the following formula n HandleNum 1000 Module 1 4 Bitnum 1 HandleNum is the handle specifier labeled with letters from A to C 1 to 3 Module is the position of the module in the rack from 1 to 16 BitNum is the I O point in the module from 1 to 4 Operand Usage N A Usage Usage and Default Details In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands SB Set Bit OB Ouput Bit OP Define output port byte wise SB Set Bit Examples CB O Clear output bit 0 CB 1 Clear output bit 1 CB 2 Clear output bit 2 53 CF Configure Unsolicited Messages Handle Full Description Sets the port for unsolicited messages By default the controller will send unsolicited data to the main RS 232 serial port
83. mples ex AT 0 Establishes reference time 0 as current time AT 50 Waits 50 msec from reference 0 AT 100 Waits 100 msec from reference 0 AT 150 Waits 150 msec from reference 0 and sets new reference at 150 AT 80 Waits 80 msec from new reference total elapsed time is 230 msec I O scan loop If inputs 1 4 and 5 are all high set output 1 high Else set ouput 1 low main ATO set time reference for AT command loop ti TIOS 32 mask inputs 1 4 and 5 00110010b 32h IF ti 32 out 1 variable for output ELSE out 0 variable for output 46 ENDIF OB 1 out AT 100 JP loop set output at the end of the scan set loop scan time to 100 ms 47 AZ Analog Output Select Full Description Selects the Analog Outputs used for the control loops Note The RIO 472xx does not have any analog outputs or control loops Arguments AZ n n or AZm n n 0 through 7 selects the analog output channel for control Set n 1 to disable control loop n returns analog output channel AF n n or AFm n where n 0 7 selects the analog input channel for feedback Set n 1 to disable control loop n Returns the input channel m A B RIO 47xx2 has 6 control loops AFn n n n n n and m A B C D E F Operand Usage _AZm contains the analog input channel selected for the specified control loop Usage Usage and Default Details While Moving Related Commands ANJ n Read Analog
84. n the range of 2147483647 to 2147483648 Usage Usage and Default Details While Moving Default Value 0 Related Commands Examples PC1 MG_PC 214 MG_PC 515 E PC MG t 718 121 PM PWM output enable Full Description PM enables the PWM output feature for the RIO 471xx Outputs 14 and 15 can be configured for PWM output with configurable frequency and duty cycle The PWM option is necessary for full resolution of the frequency See the RIO user manual for more information Arguments PM n n Where First argument corresponds to output 14 second to output 15 n 0 PWM output disabled for corresponding output n 1 PWM output enabled with high polarity high polarity with DY 100 100 duty cycle is the same as the CB state with PMO n 1 PWM output enabled with low polarity low polarity with DY 100 100 duty cycle is the same as the SB state with PMO Operands N A Usage Usage and Default Details Default Value o0 Related Commands DY PWM output duty cycle FQ PWM output frequency Examples FO100 200 Set output 14 to 100 Hz and output 15 to 100 Hz gt DY50 25 Set output 14 to 50 output 15 to 25 PM1 1 Turn PWM mode on for outputs 14 and 15 122 PS Control Setpoint Full Description The control setpoint command is used in a process control loop to specify the analog value that will be used as the setpoint The range and resolution for the setpoint is dep
85. nditional statement EN var v1l AN 1 5 some calculation for variable vl IF v1 gt 25 amp IN 4 1 Conditions based on V1 variable and input 4 status G Conditions met Message to b xecuted if IF statement is true ENDIF End of IF statement EN REM The conditions of an if statement can be simplied with the fact that REM a true condition 1 and a false condition 0 true vl 1 IF vl MG True vl vl1 ENDIF false v1 0 IF vl if statement evaluates fals ELSE MG False vl 0 ENDIF N ti IH Open IP Handle Full Description The IH command is used when the controller is operated as a master also known as a client This command opens a handle and connects to a slave server To open a handle the user must specify 1 The IP address of the slave 2 The type of session TCP IP or UDP IP 3 The port number of the slave This number is not necessary if the slave device does not require a specific port value If not specified the board will specify the port value as 1000 Each RIO 47xx0 board may have 3 handles open at any given time and the RIO 47xx2 can have 5 handles They are designated by the letters A B C on the RIO 47xx0 and A B C D and E on the RIO 47xx2 On the RIO 471x2 the IH command is used to set the realtime clock from a TIME protocol server Port 37 is used by the TIME protocol server to transmit a 32 bit unsigned integer in network byte order representing the number
86. nternet Handle DH DHCP Server Enable Examples IA 151 12 53 89 Assigns the controller with the address 151 12 53 89 TIA 2534159705 Assigns the controller with the address 151 12 53 89 IA lt 500 Sets the timeout value to 500msec 78 79 ID Identify Full Description The ID command is used to query the RIO to identify the I O hardware available The following is an example response to the ID command and a description of each line ID outputs 0 3 power sourcing outputs outputs 4 7 power sourcing outputs outputs 8 11 sinking outputs outputs 12 15 sinking outputs analog inputs 0 3 12 bits programmable range AQ analog inputs 4 7 12 bits programmable range AQ analog outputs 0 3 12 bits programmable range DQ analog outputs 4 7 12 bits programmable range DQ real time clock outputs 0 3 power type outputs where power power indicates the outputs are high power outputs No string here indicates low power outputs type specifies whether the outputs are sourcing or sinking Output information is displayed in sets of 4 bits at a time until all outputs have been described analog inputs 0 3 bit configuration where bit 12 bits indicates 12 bit resolution of the analog inputs 16 bits indicates 16 bit resolution of the analog inputs configuration range of 0 to 5 indicates the unit has non configurable analog ins eg RIO 47x0x programmable range AQ indicates
87. odbus function codes 3 read and 16 write 3 read and 16 write Number Type 16 bit unsigned integer 32 bit floating point References in A array RIO 471x2 A 0 A 999 A 0 A 999 References in A array RIO A 0 A 399 A 0 A 399 471x0 200 5 Integer only fraction not Galil 4 2 format internal from float Number read from A Integer only fraction not read 32 bit float internal to float conversion Example Modbus Master Write MBH 0 16 1000 1 write MBH 0 16 2001 2 write Example Modbus Master Read MBH 0 3 1000 1 read MBH 0 3 2001 2 read Arguments MEn Where n 0 default disables the ability for Modbus masters to write to the RIO s array table Read is always enabled through function code 3 n 1 enables ability for Modbus masters to write integer or float values using function code 16 n returns the current setting Operands N A Usage Usage and Default Details 109 Default Value LO Related Commands MB Modbus DM Dimension DA Deallocate the Variables amp Arrays Examples DA Deallocates all arrays DM A 400 Allocates array for Modbus Read Write MEO Disables write access ME1 Enables write access ME Interrogate current value This example is written for a Galil modbus master connected to an RIO 471x2 E G DMC 21x3 RIO DMC 40x0 This code runs on the master Assumes a Modbus handle is available at H and that MEl has been set on the
88. oes not have any control loops Arguments AF n n or AFm n where n 0 7 selects the analog input channel for feedback Set n 1 to disable control loop n Returns the input channel m A B RIO 47xx2 has 6 control loops AFn n n n n n and m A B C D E F Operand Usage _AFm contains the analog input channel selected for the specified control loop Usage Usage and Default Details Controller Usage Default Value 0 0 0 0 or 1 1 Default Format Related Commands AQ Analog Configuration AZ Analog Output Select PS Control Loop Setpoint Examples AFO AZO KP1 KD10 KI0 5 PS2 5 41 AI After Input Full Description The AI command is a trippoint used in motion programs to wait until after a specified input has changed state This command can be configured such that the controller will wait until the input goes high or the input goes low Hint The AI command actually halts execution until specified input is at desired logic level Use the conditional Jump command JP or input interrupt ID if you do not want the program sequence to halt Arguments Alml amp m2 amp m3 amp m4 where mn is an integer in the range 0 to 15 decimal When mn is positive the RIO will wait for the input to be high When mn is negative the RIO will wait for the input to be low Usage Usage and Default Details Controller Usage Default Value Default Format Operand Usage N A Related Commands IN n Read Digital Input
89. on 01 OR 10 is 11 3 13 Parentheses order of operations Full Description The parentheses denote the order of math and logical operations Note that the controller DOES NOT OBEY STANDARD MATHEMATICAL OPERATOR PRECEDENCE For example multiplication is NOT evaluated before addition Instead the controller follows left to right precedence Therefore it is required to use parentheticals to ensure intended precedence Arguments n where nis a math or logical amp expression Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands Math Operators amp Logical Operators Examples MG 1 2 3 9 0000 MG 1 2 3 7 0000 14 9 Semicolon Command Delimiter Full Description The semicolon operator allows multiple Galil commands to exist on a single line It is used for the following three reasons 1 To put comments on the same line as the command STX stop 2 To compress DMC programs to fit within the program line limit Note use a compression utility to do this Do not program this way because it is hard to read 3 To give higher priority to a thread All commands on a line are executed before the thread scheduler switches to the next thread Arguments n n n n where n is a valid Galil command Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands NO No Op comm
90. ontroller uses to asynchronously communicate to the host Use CF to point unsolicited traffic to this handle It is NOT recommended to use one Ethernet handle for both command and response and unsolicited messages GalilTools will by default establish a two handle connection when using Ethernet Demonstrates from GalilTools terminal that the main handle is seperate from the unsolicited handle 192 168 1 3 RIO47102 Rev 1 0c 1480 IHA IHB TH CONTROLLER IP ADDRESS 192 168 1 3 ETHERNET ADDRESS 00 50 4C 28 05 C8 HA TCP PORT 23 TO IP ADDRESS 192 168 1 100 PORT 2420 UDP PORT 60007 TO IP ADDRESS 192 168 1 100 PORT 2421 AVAILABL AVAILAB AVAILAB J m i HHHHH I 3 o a w E GS Po ain handle is A MG_CF 66 0000 Unsolicited handle 66 is ASCII for B 55 CI Configure Communication Interrupt Full Description The CI command configures a program interrupt based on characters received on communications port 2 the AUX serial port port 1 on DMC 21x2 3 amp RIO An interrupt causes program flow to jump to the COMINT subroutine If multiple program threads are used the COMINT subroutine runs in thread 0 and the remaining threads continue to run without interruption The characters received can be accessed via the internal variables P2CH P2ST P2NM P2CD P1 on DMC 21x2 3 RIO For more see Operator Data Entry Mode in the user manual Arguments CI n m m on
91. ory will be executed as thread 0 Operand Usage _XQn contains the current line number of execution for thread n and 1 if thread n is not running Usage Usage and Default Details Default Vale fo In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands HX Halt execution Examples XQ Apple 0 Start execution at label Apple thread zero XQ data 1 Start execution at label data thread one XQ 0 Start execution at line 0 162 ZC User Variable ZC Full Description ZC sets the first user variable This variable provides a method for specific board information to be passed using the data record Arguments ZCn where n can be a number RIO board operand variable mathematical function or string The range for numeric values is from 2 147 483 648 to 2 147 483 647 The maximum number of characters for a string is 4 characters Strings are identified by quotations NOTE If n is a the decimal value of ZC will be returned Usage In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand Yes Operand Usage _ZC contains the decimal value of the user variable Related Commands ZD Set second user variable Examples zc 2343 Sets the first user variable to a number 2343 163 ZD User Variable ZD Full Description ZD sets the second user variable This variable provides a method for specific board information to be passed usin
92. ote 2 Trippoints cause a program to wait for a particular event The AI command for example waits for specific inputs to go high or low If the CMDERR subroutine is executed due to an invalid command while the program is waiting for a trippoint the CMDERR can end by continuing to wait for the trippoint as if nothing happened or clear the trippoint and continue executing the program at the command just after the trippoint The EN arguments will specify how the CMDERR and COMINT routines handle trippoints Note 3 Use the RI command to return from the ININT subroutine Note 4 Trippoints occurring in other threads other than the main thread will not be affected by the CMDERR subroutine Usage Usage and Default Details While Moving no RIO Operand Usage N A Related Commands RI Return from interrupt subroutine 70 Examples A SB WT500 CB ti Ne G DONE Program A Set output 1 high Wait for 500 msec Set output 1 low Print message End of Program 71 ENDIF End of IF conditional statement Full Description The ENDIF command is used to designate the end of an IF conditional statement An IF conditional statement is formed by the combination of an IF and ENDIF command An ENDIF command must always be executed for every IF command that has been executed It is recommended that the user not include jump commands inside IF conditional statements since this causes re direction of co
93. ppoint and disable interrupt on input 3 HINT An applications program must be executing for the ININTn subroutine to function 135 RO Realtime Offset Full Description Available on RIO 471x2 only RO Sets the hour offset from GMT time for the realtime clock feature RO is used when synching the realtime clock on the RIO with a TIME server The TIME protocol provides GMT time and RO allows for localization of time RO is burnable with BN Arguments ROn where n is an integer 12 corresponding to the hourly time zone offset from GMT Operands _ROO contains the current GMT offset _RO1 contains the value last received from a network TIME protocol server See IH and RT Usage Usage and Default Details Default Value lo Related Commands RT Real Time RY Real Year Calender Feature Examples Some Time Zone Examples RO 10 Hawaii USA RO 9 Alaska USA RO 8 Pacific Time US and Canada RO 7 ountain Time US and Canada RO 6 Central Time US and Canada RO 5p Eastern Time US and Canada RO 3 Buenos Aires Argentina RO 0 London England ROL Paris France RO 2 Cairo Egypt RO 3 Plovdiv Bulgaria RO 8 Beijing China RO 9730 Tokyo Japan RO 10 elbourne Australia REM Changing RO for Daylight Savings RO 7 Pacific Daylight Time REM Hit TIME server THE 10 0 62 23 lt 37 gt 2 WT10 JS Print 136 RO 8 Pacific Standard Time
94. program after sending a Modbus command until a response from the Modbus device has been received If the response is never received then the TCPERR subroutine will be triggered and an error code of 123 will show up in _TC Arguments MWn where n 0 Disables the Modbus Wait function n 1 Enables the Modbus Wait function default n returns the state of the Modbus Wait 0 or 1 Operand Usage MW contains the state of the Modbus Wait _MWO returns last function code received _MW I returns modbus error code see User Manual for details Usage Usage and Default Details While Moving No RIO Related Commands MB Modbus Examples MW1 Enables Modbus Wait SB1001 Set Bit 1 on Modbus Handle A CB1001 Clear Bit 1 on Modbus Handle A Hint The MW command ensures that the command that was sent to the Modbus device was successfully received before continuing program execution This prevents the controller from sending multiple commands to the same Modbus device before it has a chance to execute them 116 NO No Operation Full Description The NO command performs no action in a sequence but can be used as a comment in a program After the NO characters can be given to form a program comment up to the maximum line length of the controller which is 40 This helps to document a program An apostrophe may also be used instead of the NO to document a program Arguments NO m where m is any group of letters an
95. ption The operator denotes that the following string is in hexadecimal notation Arguments nnnnnnnn mmmm n is up to eight hexadecimal digits denoting 32 bits of integer m is up to four hexadecimal digits denoting 16 bits of fraction Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands Multiply shift left Divide shift right MG 8 4 Print in hexadecimal Examples x S7ffffff 0000 y x amp 0000ffff 0000 z x amp 5 0000 0000 10000 store 2147483647 in x store lower 16 bits of x in y store upper 16 bits of x in z 12 amp Bitwise Logical Operators AND and OR Full Description The operators amp and are typically used with IF JP and JS to perform conditional jumps however they can also be used to perform bitwise logical operations Arguments n amp morn m where n and m are signed numbers in the range 2147483648 to 2147483647 For IF JP and JS n and m are typically the results of logical expressions such as x gt 2 amp y 8 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands COM n Bitwise complement IF If statement JP Jump statement JS Jump subroutine Examples IF x gt 2 amp y 4 x must be greater than 2 and y equal to 4 for the message to print MG true ENDIF MG 1 2 3 0000 Bitwise operati
96. r RIO not valid for RIO not valid for RIO not valid for RIO not valid for RIO not valid for RIO not valid for RIO 149 a mn rd 54 Question mark part ot SSCS SSCS s ii py 56 Array index invalid or outofrange JOO oS o 0 om O 5s Bad command response Ge ONE o Mismatched parentheses OOOO O CS 60 Download error line to Jong or too many Tes __ a Dowda SCS e Morwa i CS a statement witht enDi O O SSS s IN command must have acomma ___ COM ST EN 67 Too many arrays or variables SSS CSCS P CENTENO AE 30 Reoord mode already remain __ si o array or source spell fs undefined Arey i CS s ATTE A fsa Toomany elements CS o Tomy ABCD valid operand oaao SM jumper needs to be installed for stepper motor operation no Accelera no RIO o Bd Binary Command Format 58 Binary Commands not valid in application progam 9 Bad diary command number SSSSCiCS fog Notvalid when axis performing ECAM notvalidforRIO ios EBT command must be given first oval for RIO Privilege Violation Dor valid for Econo Optima 119 Notvalidforaxiscomfiguredasstepper 120 BadEthemettramsmit nt valid for PCL 121 Bad Ethernet packet received nt valid for PCT 122 Fthemetimputbufferovemen OOOO MC io hom OOOO oe 124 Ethernet handle already in use notvalid for PCI ms No ARP response from IP address e PC 126 Closed Ethernet handle 127 legal Modbus function code nai for gt 128
97. race Examples BK 3 Pause at line 3 the 4th line in thread 0 BK 5 Continue to line 5 SL Execute the next lin Si lt 3 Execute the next 3 lines BK Resume normal execution 49 BN Burn Full Description The BN command saves certain board parameters in non volatile EEPROM memory This command typically takes 1 second to execute and must not be interrupted The RIO board returns a colon when the Burn is complete The RIO product line has a maximum of 10 000 write cycles for burning BV BP BN combined Parameters saved during burn Arguments N A Operand Usage _BN contains the serial number of the processor board Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands BP Burn Program BV Burn Variables and Array Examples sB17 Set bit 1 CBA Clear bit 2 CWE Set data adjustment bit BN Burn all parameter states 50 BP Burn Program Full Description The BP command saves the application program in non volatile EEPROM memory This command typically takes up to 1 seconds to execute and must not be interrupted The unit returns a when the Burn is complete The RIO product line has a maximum of 10 000 write cycles for burning BV BP BN combined Arguments None Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format In a Program No Command Line Yes Can be Interrogated No Used as
98. rogram running on the Galil controller the program all threads will stop Use EN to end the routine CMDERR will only run from errors generated within embedded DMC code Arguments N A Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands TC Tell Error Code _ED Last program line with an error EN End program Examples This example shows a bug in DMC code CMDERR detects the bug at runtime and provides debugging info 1 mysub user subroutine xx Accidental typo bad command EN 1 CMDERR runs if an error occurs G An error occured at line ED TC1 print type of error info ZS Remove returns from the callback stack EN End execution COMINT Communication interrupt automatic subroutine Full Description COMINT is an automatic subroutine which can be configured by the CI command to run either when any character is received or when a carriage return is received over the com port The auxiliary port is used if equipped COMINT runs in thread 0 and an application must be running in thread 0 in order for COMINT to be enabled Code running in thread zero will be interrupted by the COMINT subroutine Use EN to end the routine Arguments N A Operand Usage N A Usage Usage and Default Details While Moving Related Commands P1CD Serial port code P1CH Serial port single character
99. rse tangent Full Description Returns in degrees the arc tangent of the given number Arguments ATAN n n is a signed number in the range 2147483647 to 2147483647 Operand Usage N A Usage Usage and Default Details Related Commands ASIN Arc sine SIN Sine ACOS Arc cosine COS Cosine TAN Tangent Examples MG ATAN 10 84 2894 MG ATAN O 0 0000 MG ATAN 10 84 2894 21 COM Bitwise complement Full Description Performs the bitwise complement NOT operation to the given number Arguments COM n where n is a signed integer in the range 2147483647 to 2147483647 The integer is interpreted as a 32 bit field Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands amp Logical operators AND and OR Examples MG 8 0 COM 0 SFFFFFFFF MG 8 0 COM SFFFFFFFF 00000000 22 COS Cosine Full Description Returns the cosine of the given angle in degrees Arguments COS n where n is a signed number in degrees in the range of 32768 to 32767 with a fractional resolution of 16 bit Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands ASIN n Arc sine ASIN n Sine QATANT n Arc tangent YACOS n Arc cosine TAN n Tangent Examples MG COS 0 1 0000 MG COS 90 0 0000 MG COS 180 1 0000 MG COS
100. s after the decimal point Case 3 Message command sends any ASCII characters to the port MG 13 30 37 N Sends carriage return characters 0 and 7 followed by no carriage return line feed command to the port 111 112 MI Modbus Integer Full Description The MI command specifies whether the RIO as a Modbus slave will respond to Analog I O related Modbus requests in volts represented by 32 Bit Floating Point notation or in counts represented as a 16 Bit Integer The MI command affects the way the RIO responds to function codes 3 4 and 16 Some modbus software packages may require the data to be in integer format When MI is set to 1 the range of the 16 bit integer depends on the AQ and DQ setting Please see the RIO user manual for details Arguments MI n where n 0 enables 32 Bit Floating Point notation volts n 1 enables data returned as a 16 bit integer counts n returns the state of the MI command 0 or 1 Operand Usage _ MI can not be used as an operand Usage Usage and Default Details While Moving Default Value 0 Related Commands MB Modbus MW Modbus Wait MV Modbus Reversal Examples MI1 Set slave to respond to Analog I O related Modbus requests in counts 113 MS Email Source Address Full Description The MS command sets the email source address max 30 characters default is null Arguments MS string where string is the email source address
101. s in the I O block of the QR record Fourth field returns 0 representing nothing Arguments QZ Operand Usage N A Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No Related Commands QR Data Record Examples 02 Enter Command 25 Ar AB 0 129 RA Record Array Full Description The RA command selects one or two arrays for automatic data capture The selected arrays must have been dimensioned by the DM command The data to be captured is specified by the RD command and time interval by the RC command Arguments RA n m where n m are dimensioned arrays as defined by DM command The contain nothing Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands DM Dimension Array RD Record Data RC Record Interval Examples Record Label DM Input 100 Define array for input status RA Input Specify Record Mode RD TI Specify data type for record RE Tp Begin recording at 2 msec intervals EN End GalilTools The GalilTools Realtime scope can often be used as an alternative to record array 130 RC Record Full Description The RC command begins recording for the Automatic Record Array Mode RA RC 0 stops recording Firmware Note Do not allocate or deallocate arrays DM DA while the Automatic Record Array Mode is
102. sage and Default Details While Moving No RIO Default Format Default Value 1 In a Program No Command Line Yes Related Commands BK Breakpoint TR Trace Examples BK 3 Pause at line 3 the 4th line in thread 0 BK 5 Continue to line 5 SL Execute the next lin SL 3 Execute the next 3 lines BK Resume normal execution 146 SM Subnet Mask Full Description The SM command assigns a subnet mask to the controller All packets sent to the controller whose source IP address is not on the subnet will be ignored by the controller For example for SM 255 255 0 0 and IA 10 0 51 1 only packets from IP addresses of the form 10 0 xxx xxx will be accepted Arguments SM sm0 sm1 sm2 sm3 or SM n where sm0 sm1 sm2 sm3 are 1 byte numbers 0 to 255 separated by commas and represent the individual fields of the subnet mask n is the subnet mask for the controller which is specified as an integer representing the signed 32 bit number two s complement SM will return the subnet mask of the controller Operand Usage _SMO contains the IP address representing a 32 bit signed number Two s complement Usage Usage and Default Details Controller Usage E a Default Value SM 0 0 0 0 Default Format Related Commands IH Internet Handle IA IP address Examples SM 255 255 255 255 Ignore all incoming Ethernet packets SM 00 0 0 Process all incoming Ethernet packets 147 TB Tel
103. se an integer between zero and sixteen indicates zero for beginning condition and sixteen for the deepest value Usage Usage and Default Details While Moving No RIO Default Value 0 Related Commands Examples IIO ld Input Interrupt on 7 HA JP A EN ain program ININTO Input Interrupt MG INTERRUPT Print message S _25 Interrogate stack before ZS S Print stack ZS Zero stack S _25 Interrogate stack after ZS S Print stack 165
104. se EN to end the routine Arguments N A Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands BP Burn program EN End program AUTOERR Automatic Subroutine for EEPROM error Examples On startup this code will create a 50 duty cycle square wave on output 1 with a period of 1 second AUTO Start on powerup sB1 Set bit 1 WT500 Wait 500msec CB1 Clear bit 1 WT500 Wait 500msec JP AUTO Jump back to AUTO AUTOERR Automatic subroutine for notification of EEPROM checksum errors Full Description AUTOERR will run code upon power up if data in the EEPROM has been corrupted The EEPROM is considered corrupt if the checksum calculated on the bytes in the EEPROM do not match the checksum written to the EEPROM The type of checksum error can be queried with RS Use EN to end the routine Arguments N A Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format Related Commands _RS Checksum error code operand EN End program Examples Code detects a checksum error and notifies the user AUTOERR MG EEPROM ERROR RS EN CMDERR Command error automatic subroutine Full Description CMDERR is an automatic subroutine that runs code when a DMC code error occurs Without CMDERR defined if an error see TC command occurs in an application p
105. sed in a single jump statement The conditional statements are combined in pairs using the operands amp and The amp operand between any two conditions requires that both statements must be true for the combined statement to be true The operand between any two conditions requires that only one statement be true for the combined statement to be true Note Each condition must be placed in parenthesis for proper evaluation by the controller A jump is taken if the specified condition is true Each condition must be placed in parenthesis for proper evaluation by the controller Example JSta var0 1 amp varl 2 valid conditional jump JStta var0 18varl 2 invalid conditional jump Arguments JS destination condition where destination is a line number or label condition is an optional conditional statement using a logical operator The logical operators are lt less than or equal to gt greater than equal to lt less than or equal to gt greater than or equal to lt gt not equal Operand Usage Usage Usage and Default Details While Moving No RIO Related Commands amp Bitwise Logical Operators AND and OR EN End Examples 94 JS SQUARE JS LOOP JS A y V1I lt 5 V1 lt gt 0 Jump to subroutine SQUARE if Vl is less than 5 Jump to LOOP if V1 is not equal to 0 Jump to subroutine A unconditionally 95 KD Derivative Constant Full
106. set bit 3 OB N COUNT 1 If element 1 in the array is zero clear bit N 118 OF Offset Full Description The OF command sets a bias voltage on the control output AF AZ must be set prior to changing OF Arguments OF n n or OFm n where n is a signed number whose range is 2 5V to 2 5V on the RIO 4710x and is determined by the DQ command on the RIO 4712x Resolution for both is 0 0001 n Returns the offset for the specified channel m A B RIO 47xx2 has 6 control loops OFn n n n n n or m A B C D E F Operand Usage _OFm contains the offset value for the specied axis Usage Usage and Default Details While Moving No RIO Default Value Jo Related Commands Examples AFO 1 AZO 1 OF 2 Set control channel A to 2 Leave other channel unchanged OF 0 Set control channel B to 0 Leave other channel unchanged OF Return offsets 2 0000 0 0000 OF Return A offset 2 0000 OF 57 Return B offset 0 0000 119 OP Output Port Full Description The OP command sends data to the output ports of the controller You can use the output port to control external switches and relays The arguments of the OP command are the decimal representation of the general output bits 0 through 7 For example OP255 0 sets all outputs in bank 0 bits 0 7 high and all outputs in bank 1 bits 8 15 low Arguments OP m n where m and n are integers in the range 0 to 255 decimal or 00 to FF hexadecimal Arguments Bloc
107. teger in the range of 0 to 100 and sets the PWM Duty cycle percentage Duty cycle is percentage ON with positive polarity and percentage OFF with negative polarity See PM for polarity Operands N A Usage Usage and Default Details Default Value 10 0 Related Commands FQ PWM output frequency PM PWM output enable Examples FO100 200 Set output 14 to 100 Hz DY50 25 Set output 14 to 50 and output 15 to 100 Hz output 15 to 25 PM1 1 Turn PWM mode on for outputs 14 and 15 67 ED Edit Full Description Using Telnet style interface not Galil Software The ED command puts the RIO board into the Edit subsystem In the Edit subsystem programs can be created changed or destroyed The commands in the Edit subsystem are cntrl D Deletes a line cntrl I Inserts a line before the current one cntrl P Displays the previous line cntrl Q Exits the Edit subsystem return Saves a line Arguments ED n where n specifies the line number to begin editing The default line number is the last line of program space with commands Operand Usage _ED contains the line number of the last line to have an error Usage Usage and Default Details While Moving Controller Usage Default Value Default Foma In a Program No Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands DL Download UL Upload Examples 000 BEGIN 001 CB1 002 SB3 003 S
108. the RIO to a host computer Programs are sent without line numbers In the Galil software the UL command is not necessary because the UL command is handled by the graphical interface Upload Program In a terminal utility such as HyperTerminal or Telnet the UL command will bring the uploaded program to screen From there the user can copy it and save it to a file In Hyper Terminal the UL command will be followed by a lt control gt Z or a as an end of Text marker Arguments None Operand Usage When used as an operand UL gives the number of available variables The total number of variables is 126 on the RIO 47xx0 or 254 on the RIO 47xx2 Usage Usage and Default Details Controller Usage Default Value o Default Format In a Program No Command Line Yes Can be Interrogated No Used as an Operand Yes Related Commands DL Download Examples UL Begin upload A Line 0 sB17 This is an Example Line 1 CBi T Program Line 2 EN Line 3 entra Terminator 158 VF Variable Format Full Description The VF command formats the number of digits to be displayed when interrogating the RIO board If a number exceeds the format the number will be displayed as the maximum possible positive or negative number i e 999 99 999 8000 or 7FF Arguments VF m n where m and n are unsigned numbers in the range 0 lt m lt 10 and 0 lt n lt 4 m represents the number of digits before the decimal point A
109. ult Format While Moving Yes Default Value In a Program Yes Default Format Command Line Yes AN J is an operand not a command It can only be used as an argument to other commands and operators Related Commands AQ Analog Range AO Analog Output Examples MG AN 1 print analog input 1 1 7883 x AN 1 assign analog input 1 to a variable 18 AO Analog Output Query Full Description The AO n command is used to query the value of an Analog Output On the RIO 4712x use the DQ command to specify the voltage output range Note The RIO 472xx does not have any analog outputs by default Arguments AO n where n is the I O number assigned to a particular analog output pin 0 7 Operand Usage N A Usage Usage and Default Details While Moving No RIO Related Commands AO Analog Output DQ Set analog output range Examples MG AO 0 Displays status of Analog output 0 Temp AO0 0 Sets variable Temp to the value of Analog output 0 19 ASIN Inverse sine Full Description Returns in degrees the arc sine of the given number Arguments ASIN n where n is a signed number in the range 1 to 1 Operand Usage N A Usage Usage and Default Details Related Commands YACOS n Arc cosine ASIN n sine ATANJ n Arc tangent COS n Cosine TAN n Tangent Examples MG ASIN 1 90 0000 MG ASIN O 0 0000 MG ASIN 1 90 0000 20 ATAN Inve
110. wo different ways 5 0000 38 AA After Analog Trippoint Full Description AA is a trippoint that halts program execution until a voltage on a particular analog input has been reached The range of AA is dependant on RIO hardware See the AQ command for more info Arguments AA m n o where m is the analog input 0 7 n the voltage range is 0 5V for RIO 47x0x range dependent on AQ for RIO 47x2x o 0 for Trippoint to clear when voltage is greater than n 1 for Trippoint to clear when voltage is less than n Operand Usage N A Usage Usage and Default Details In a Program Yes Command Line Yes Can be Interrogated No Used as an Operand No N A Related Commands AN x Function to query the voltage on an analog input AQ Set analog input ranges Examples A REM Wait for analog input 3 to go above 2 5V AA 3 2 5 0 G Analog input 3 reached 2 5V EN 39 AB Abort Full Description AB Abort aborts the application programs including any threads Arguments AB Operand Usage N A Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Related Commands HX Halt Execution XQ Execute Program Examples AB Abort application program 40 AF Analog Feedback Select Full Description The Analog Feedback AF command is used to select which analog input channel will be used for feedback if a control loop is desired Note The RIO 472xx d
111. y KP 8 Specify B channel only KP Return A B channel 2 7 14 KP values 98 LA List Arrays Full Description The LA command returns a list of all arrays in memory The listing will be in alphabetical order The size of each array will be included next to each array name in square brackets Arguments None Operand Usage N A Usage Usage and Default Details While Moving No RIO In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand No Related Commands LL List Labels LS List Program LV List Variable Examples LA Interrogation Command CA 10 RIO board returns a list of 4 Arrays LA 5 NY 25 VA 17 99 LL List Labels Full Description The LL command returns a listing of all of the program labels in memory The listing will be in alphabetical order Arguments None Operand Usage N A Usage Usage and Default Details Controller Usage Default Value Default Format In a Program Yes Command Line Yes Can be Interrogated Yes Used as an Operand No Related Commands LV List Variables Examples LL Interrogation Command IVE RIO board returns a list of 5 labels OUR N j tj E P THREE TWO He He de SE Se ee O 100 LS List Full Description The LS command sends a listing of the program memory The listing will start with the line pointed to by the first parameter which can be either a line number or a label I

Download Pdf Manuals

image

Related Search

Related Contents

A2BP pro  CAMCOLVC17  Canon IP6000 User's Manual  Mode d`emploi P 4.x et P4.8x - buehler    Philips SWV3432W 6 ft High speed HDMI cable  Eizo FS2331  Acer Aspire E5-471-362L  KARIMA LAHMOUZ  Atlantis Land 1.5m USB 2.0 A - Micro USB 2.0 B M/M  

Copyright © All rights reserved.
Failed to retrieve file