Home
RIO-47100 User Manual
Contents
1. of of Controller porary program E ot of labels HOT CONTO Ethernet elements variables loops lines handles RIO 47xx0 400 200 126 62 2 3 RIO 47xx2 1000 400 256 126 6 5 RIO Functional Elements Microcomputer Section The main processing unit of the RIO is a specialized 32 bit Freescale Microcomputer with 32KB SRAM and 256KB of Embedded Flash memory The SRAM provides memory for variables array elements and application programs The flash memory provides non volatile storage of variables programs and arrays it also contains the RIO firmware The RIO can process individual Galil Commands in approximately 40 microseconds The RIO product line has a maximum of 10 000 write cycles for burning BN BP BV combined Communication The communication interface with the RIO consists of one RS 232 port default is 115 kBaud s and one 10 100Base T Ethernet port jumper configurable There are four status LEDs on the RIO that indicate operating and error conditions on the controller Figure 1 1 shows a diagram of the LED bank followed by the description of the four lights PWR EJ EJ LNK ERR El C ACT Figure 1 1 Diagram of LED bank on the RIO Green Power LED PWR The green status LED indicates that the power has been applied properly to the RIO Red Status Error LED ERR The red error LED will flash on briefly at power up After the initial power up condition the LED will illuminate f
2. Mathematical and Functional Expressions Mathematical Operators For manipulation of data the RIO provides the use of the following mathematical operators RIO 47xxx Chapter 5 Programming e 61 Operator Function OOOO Subtraction Multiplication 1 Logical Or On some computers a solid vertical line appears as a broken line _ The numeric range for addition subtraction and multiplication operations is 2 147 483 647 9999 The precision for division is 1 65 000 Mathematical operations are executed from left to right Calculations within parentheses have precedence Examples SPEED 7 5 V 1 2 The variable SPEED is equal to 7 5 multiplied by V1 and divided by 2 COUNT COUNT 2 The variable COUNT is equal to the current value plus 2 RESULT Vall Puts the value of Vall 28 28 in RESULT 40 cosine of 45 is ECOS 45 40 28 28 K IN 1 amp IN 2 K is equal to 1 only if Input 1 and Input 2 are high Note Mathematical operations can be done in hexadecimal as well as decimal Just precede hexadecimal numbers with a sign so that the RIO recognizes them as such 62 Chapter 5 Programming RIO 47xxx Bit Wise Operators The mathematical operators amp and are bit wise operators The operator amp is a Logical And The operator is a Logical Or These operators allow for bit wise operations on any valid RIO numeric operand including variables array elements numeric values functions key
3. USER MANUAL RIO 47xxx Manual Rev 1 0k By Galil Motion Control Inc Galil Motion Control Inc 270 Technology Way Rocklin California 95765 Phone 916 626 0101 Fax 916 626 0102 Email supportOgalilmc com URL www galilmc com Rev Date 01 2011 Contents A NN I CHAPTER T OVERVIEW iosscccectssicctiscscssestinsiceducecscssuisls code suceststcsbs cade sessd vls foua KEOS ESUS ES Sena s STEES t 1 NA ss atan FS E a S E EO E EE EEE EEEE ERSA 1 PART NUMBERING OVERVIEW eaire aa aerae yo e aara r EEE AEE ao yok po e EEEa SER ESER popo aare EESE Eai a 2 IDIOTA O A 3 RIO Functional Element 2 00 cc cccc ceessecscceusessdesctaceceuedecebencansecedeasseddacaedeevd duds dua e e e ara E EEE a iones 3 CHAPTER 2 GETTING STARTEDcscicionocosciconioneciocosincininnsio sa suctessossecesuspeadessaseausssssedsastocdessestsucsesseseasnenssutsun 4 RIO ATI A a anka ed 4 EALO E TA O E EE o Aia 5 INSTALLING THE RIO BOARD vcsecestssnsssssuvevssp cveveseesesunsiece save sa TECEN OEE EE Ee EEE ERTEN Ee ESERE NEEE E SESE ESEE RESTES 5 Step 1 Configure JUMP Sporni oeiee titi 5 Step 2 Connecting Power to the RIO osere e aaae e R a r e a N aei i 6 Step 3 Install the Communications Software seseseeeseeeeesesesesesreeresertsestsestetseststetretstssesesteeretsessesreereree 7 Step 4 Establish Communications between RIO and the Host PC oooccocccocacocanocconnconoconoconoconocnnocnnonanonns 7 Communicating to the RIO using Galil Software
4. 2 When ordered with 08 15 SOURCE this pin will actually be Output Power Ground for DO 8 15 3 When ordered with 08 15 SOURCE this pin will actually be 5 24V Output Power Supply for DO 8 15 When ordered with HS option DI3 is high speed input and DI2 is high speed input DI2 is lost 7 PWM outputs See PWM option in Appendix and Chapter 4 26 pin D Sub Connector RIO 471xx Description Description Description No Connect No Connect No Connect 47100 No Connect 47120 12V out 10mA No Connect 47100 No Connect 47120 12V out 10mA Analog Input 7 Ground Analog Input 6 Analog Input 4 Analog Input 5 Analog Input 3 Analog Input 1 Analog Input 2 Analog Input 0 Ground Ground Analog Output 7 Analog Output 5 Analog Output 6 Analog Output 4 Analog Output 2 Analog Output 3 Analog Output 1 Ground Analog Output 0 RIO 47xxx Appendix e 83 Screw Terminals RIO 472xx Label 18 36 RET AGND AGND AIO All AI2 AB AI4 AIS AI6 AI7 INCOA INCOB DIO Dn DI2 DI3 DI4 DIS DI6 DI7 INCIA INCIB DI8 DI9 Description Label Return side of logic power input a Analog Input 2 DI11 OPOA Analog Input 4 DOO Digital Input 3 OP DO DO DO DO DO D Digital Input 2 OPIA Digital Input 4 OPIB OB 1 2 3 4 5 07 OS Digital Input 5 DO9 Digital I
5. Modbus Exceptions arere eer Aa aa 15 Function Code 1 01 Read Coils cccccccccccscccsccssecssecsseessesssesecesscesecsecsaecssecssecseccsescstseseecesesssesssensceaes 17 Function Code 2 02 Read Discrete Inputs c ccccccceseesceseesceseeseesecseeseceeeecsaeeseneeeaeeaeeneeeeeeseeseeaeenees 19 RIO 47xxx Contents e i Function Code 3 03 Read Holding Registers c ccssescsseseescsseseescseseeecaeeseeecaseaeencateaeencateaeereneeaes 21 Function Code 4 04 Read Input Registers oooccccinnncnonococnnonononncnnononnonnononnonnononnon ooaoeoouoeaoeoouononooanonon 24 Function Code 5 05 Write Single Coil cccccecccsceeccseesceseeseesecseesecseesecaaeeceaesaeeecsaeceesaecseeaeeseeneeeaees 27 Function Code 6 06 Preset Single Register ooononincinnncincncnocononncnnononnnnnoncnnononnco conc onnn nono nnnnnoncrncn canes 29 Function Code 7 07 Read Exception StatUS oooononoononnonnononnnoncnnnonconnonnonnonncononnnnnon non non non r cn ncnnrnncnnns 31 Function Code 15 SOF Write Multiple Coils ccccccsceseesseseeseesecseeeeceeeeecaeesensecaeeaeeneeeeseseeseneeaees 33 Function Code 16 10 Write Multiple Registers 00 0 0 cccseseescssessesesseseeeceseaeeecseeaeeecateaeeecneeaeensaeenes 35 Analog IO Ram gesis 2ss 5 sss si sasees sseascs sbeubed sont odin evessccpugea aE EEE EEE ERE E Ee EEEE E Sae eE EESE 38 DATA RECORD anota elite 39 OR and DR Command el caes 39 RIO Data A ON 39
6. SSI Clock QUAD maximum frequency The encoders must be powered by an external power supply The RIO does not supply power to the encoder AM23LV32 AMP26LV31 8 MHz Hardware update rate Register read by the QE command is updated at a rate of 40Hz QUAD Pinout Encoder Signal Label Connector Pin Channel 0 A DO14 J4 24 Channel 0 A DO12 J4 39 Channel 0 B DO15 J4 38 Channel 0 B DO13 J4 9 Channel 1 A DI14 J4 31 Channel 1 A DI12 34 2 Channel 1 B DI15 J4 1 Channel 1 B DI13 4 17 Ground N C 34 41 SSI Pinout Encoder Signal Label Connector Pin Channel 0 Clock DO14 J4 24 Channel 0 Clock DO12 J4 39 Channel 0 Data DO15 J4 38 Channel 0 Data DO13 34 9 Channel 1 Clock DI14 J4 31 Channel 1 Clock DI12 J4 2 Channel 1 Data DI15 J4 1 Channel 1 Data DI13 4 17 Ground N C 34 41 Part number ordering example PWM RIO 47122 QUAD Using the DY PM and FQ commands digital outputs 14 and 15 can be configured as PWM outputs with a frequency range of 10 20 000 Hz This is only available on firmware Revs D and above By default the maximum frequency output will be limited by the bandwidth of the digital outputs With the PWM option the opto isolated outputs are bypassed and buffered outputs are supplied for DO 14 15 RIO 47xxx Appendix e 79 Electrical Specifications for D
7. V3 TIME Assign V3 the current value of the time clock Arrays For storing and collecting numerical data the RIO 47xx0 provides array space for 400 elements This number is increased to 1000 array elements on the RIO 47xx2 The arrays are one dimensional and up to 6 different arrays may be defined Each array element has a numeric range of 4 bytes of integer 2 followed by two bytes of fraction 2 147 483 647 9999 Arrays can be used to capture real time data such as the bit status of a particular I O bank Defining Arrays An array is defined with the command DM The user must specify a name and the number of entries to be held in the array An array name can contain up to eight characters starting with an uppercase alphabetic character The number of entries in the defined array is enclosed in Example DM IOSTAT 100 Defines an array names IOSTAT with 100 entries DA Frees array space using Deallocate command Assignment of Array Entries Like variables each array element can be assigned a value Assigned values can be numbers or returned values from instructions functions and keywords Array elements are addressed starting at count 0 For example the first element in the OUTPUT array defined with the DM command DM OUTPUT 7 would be specified as OUTPUT O Values are assigned to array entries using the equal sign Assignments are made one element at a time by specifying the element number with the associated
8. VF command is used to format variables and array elements The VF command is specified by VF m n where m is the number of digits to the left of the decimal point 0 thru 10 and n is the number of digits to the right of the decimal point 0 thru 4 A negative sign for m specifies hexadecimal format The default format for VF is VF 10 4 Hex values are returned preceded by a and in 2 s complement V1 10 Assign V1 Vl Return V1 0000000010 0000 Default format VF2 2 Change format Vl Return V1 10 00 New format VF 2 2 Specify hex format Vl Return V1 0A 00 Hex value VFI Change format Vl Return V1 9 Overflow RIO 47xxx Chapter 5 Programming e 71 Local Formatting of Variables VF command is a global format command that affects the format of all relevant returned values and variables Variables may also be formatted locally To format locally use the command Fn m or n m following the variable name and the symbol F specifies decimal and specifies hexadecimal n is the number of digits to the left of the decimal and m is the number of digits to the right of the decimal For example Examples V1 10 Assign V1 Vl Return V1 0000000010 0000 Default Format V1 F4 2 Specify local format 0010 00 New format V1 4 2 Specify hex format 000A 00 Hex value VI ALPHA Assign string ALPHA to V1 VI S4 Specify string format first 4 characters ALPH The local format is also used with the MG comma
9. number of coils or the number of registers to read write array is the array in which data from a read gets stored or where data to write is stored See individual function code descriptions in the command reference for specifics of this command 3 Issue another Galil command that supports Modbus The following Galil commands support Modbus and are an easy way to use the Modbus protocol SB CB AO OB IN OUT GAN GAO The I O number variable to use with these commands when using Modbus can be calculated as follows T O Number HandleNum 1000 bitNum Modbus Exceptions An RIO configured as a slave will return an exception response if it receives an invalid request e g An invalid function code or a communication error As aclass 1 Modbus device the RIO 47xxx can respond with exception codes 01 or 02 Exception code 01 is returned when a request referencing an Illegal RIO 47xxx Chapter 3 Communication e 15 Function is received Exception code 02 is returned when a request referencing an Illegal Data Address is received When an Exception Response occurs the function code of the response is 80 added to the original function code e g Improper use of function code 01 will result in the exception response 81 An RIO 47xxx configured as a master can query the function code of the last response it received using the _MW command see command reference The _MW command can be used to determine if an exception
10. 0000 0007 The RIO will accept a request with a quantity of registers field up to 0008 if MI is set to 0 and 00010 if MI is set to 1 The RIO will respond with a byte count ranging from 0000 to 0020 if MI is 0 and from 0000 to 0010 if MI is 1 Byte Count 2 NumberOfRegisters where NumberOfRegisters is equal to the number of analog inputs you are trying to read multiplied by 2 if MI is 0 or 1 if MI is 1 The RIO will respond with a byte count field equal to the byte count field in the request packet The RIO will respond with a register value field consisting of either 2 bytes counts or 4 bytes 32 bit floating point per analog input in ascending order from the analog input referenced in the address RIO 47xxx Chapter 3 Communication e 21 Galil Register Map Register Address 32 Bit Floating Point Counts 0 Analog Input 0 Analog Input 0 1 Analog Input 1 2 Analog Input 1 Analog Input 2 3 Analog Input 3 4 Analog Input 2 Analog Input 4 5 Analog Input 5 6 Analog Input 3 Analog Input 6 7 Analog Input 7 8 Analog Input 4 9 10 Analog Input 5 11 12 Analog Input 6 13 14 Analog Input 7 15 Examples MBA 3 2 4 array MG AN 1002 Request the status of holding registers 2 5 AN1 and AN2 if MIO or AN2 AN3 AN4 ANS if MII The response is stored in array Requests the status of analog input 2 result is transmitted via serial port or ethernet 22 Chapter 3 Communication RIO 47xxx Packets
11. 18010 bon ETc ron 33 ora apris soma MP fons DW Kot an lidi 222183 a gt sis EXT POWER a ja las SERIAL ANALOG E 8 Es lt O 2601 17A03 BA02 33 E 8158 24107 18408 Genn E agate 19 SND 5an z 22 A13 a 4A14 5 anc 29 no tono UNC tic 10 NC O GALIL MOTION CONTROL ETHERNET PoE MADE IN USA Units in centimeters RIO 47xxx Appendix e 87 RIO 472xx 206 9 fe 194 9 ig 182 5 ES Rio 47200 go 22 oonoonooononoooon ooonnonoonnaoann O 3325 AHNASSASANNeNNNs SBSSSSSS8555555 ZHE GALIL MOTION CONTROL MADE IN USA iz ols a O S0P0NDIH DIE DIH AJ ON DIK DIK DIK ON ONO 89 4 mm Pan Units in millimeters 88 Appendix RIO 47xxx Accessories and Options Product Description RIO 47100 Remote I O controller with 0 5V analog I O 12bit RIO 47
12. 483x6 will be setup for type K thermocouple inputs Types E J and T are also available The thermocouples interfacing to the SCB 483x6 must have an Ungrounded or Exposed Junction aka Floating Junction contact Galil if Grounded Junction thermocouples are required Figure 14 SCB 48316 Figure 15 SCB 48306 1 Analog inputs 0 5 will not be available for general use analog inputs when the SCB 483x6 is connected to the RIO RIO 47xxx A2 SCB 48306 48316 e 97 Specifications Number of Inputs 6 Thermocouple Inputs Thermocouple input Analog Input Map TC O0 5 AI 0 5 Range Type K default 0 345 deg C Type E 0 230 deg C Type J 0 270 deg C Type T 0 345 deg C Voltage Constant Type K default 10 15 mV deg C Type E 15 225 mV deg C Type J 12 925 mV deg C Type T 10 15 mV deg C 1 Contact Galil if required temperatures are outside of listed ranges 2 Voltage Constant will change if Range is modified Wiring The SCB 483x6 has qty 6 thermocouple inputs The thermocouples interfacing to the SCB 483x6 must have an Ungrounded or Exposed Junction contact Galil if Grounded Junction Figure 17 thermocouples are required The wiring of the thermocouple to the SCB 483x6 is shown in Figure 16 below TC O5 a TC 0 5 Figure 16 Thermocouple Wiring to SCB 483x6 Figure 17 Grounded Thermocouple Input Not supported with SCB 483x6 98 A2 SCB 48306 48316 RIO 47xxx Operation The SCB 483x6 wil
13. A standard Windows HyperTerminal session can connect to the controller using a straight through serial cable Check to insure that the baud rate jumpers have been set to the desired baud rate as described above Also the hardware handshake lines RTS CTS need to be connected See Chapter 3 for more information on Handshake Modes Ethernet Connect the RIO Ethernet port to your computer via an Ethernet crossover cable or to a network hub by a straight through Ethernet cable An IP address needs to be assigned via a DHCP server through Galil software or via a serial cable using the IA command See Chapter 3 for more information on how to establish an IP address Once an IP address is established a standard Windows Telnet session can connect to the controller Note that the RIO 471x2 supports auto crossover detection auto MDIX Sending Test Commands to the Terminal after a successful Connection After connecting to the computer or terminal press lt carriage return gt or the lt enter gt key on the keyboard In response to carriage return CR the controller responds with a colon Now type RIO 47xxx Chapter 2 Getting Started e 7 TZ CR This command directs the RIO to return the current I O status The controller should respond with something similar to the following TA Block 0 7 0 Inputs value 255 1111_1111 Block 1 15 8 Inputs value 255 1111_1111 Block 0 7 0 Outputs value O 0000 0000
14. Block 1 15 8 Outputs value O 0000 0000 Analog Inputs 7 0 0 0000 0 0000 0 0000 0 0000 0 0037 0 0012 0 0000 0 0000 Analog Outputs 7 0 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 8 Chapter 2 Getting Started RIO 47xxx RIO Web Server The RIO has a built in web server that can be accessed by typing the IP address of the controller into a standard web browser The controller comes from the factory without any IP address assigned so a user must go through the steps outlined above to establish an IP address before the web server is accessible Figure 3 shows an output of the RIO Web Server RIO WO Controller Mozilla Firefox File Edit View History Bookmarks Split Tools Help a e it C http 192 168 15 4 RIO CONTROLLER DIGITAL INPUT STATES 15 14 13 22 11 5 0 AAN m A A Firmware Rev 1 0 teen at DIGITAL OUTPUT STATES as 14 13 12 12 10 9 8 7 6 5 a 3 2 1 o GALIL IAEA THREAD STATUS Serial Number 3 2969844 Command 554 execute Figure 3 RIO Web Server Output RIO 47xxx Chapter 2 Getting Started e 9 Chapter 3 Communication Introduction The RIO has one RS 232 port and one Ethernet port The RS 232 port is the data set and it is a standard serial link with a communication baud rate up to 115kbaud The Ethernet port is jumper configurable for 10 or 100Base T default RS232 Port The RIO board has
15. Display the analog voltage reading on input 2 AA 1 4 5 0 Wait until the voltage on input 1 goes above 4 5V AA 1 3 2 1 Wait until the voltage on input 1 goes below 3 2V Analog Outputs Analog output voltage is set with the AO command The AO command has the format AO m n where m is the output pin and n is the voltage assigned to it The analog output voltage is accessed with the AO n function where n is the analog output channel Analog output modules come with a resolution of 12 bits 16bit optional The standard voltage range is 0 to 5 VDC for the RIO 47100 The Analog Output voltage range is configurable using the DQ command when using the RIO 47120 Use the ID command to see the model number of the RIO Note When analog output values are accessed from the Data Record or from the Record Array function the returned value will be an integer number that represents the analog voltage For a RIO 47100 the equation used to determine the decimal equivalent of the analog voltage is as follows N V Vlo 4095 Vhi Vlo Where N is the integer equivalent of the analog voltage V is the expected analog voltage Vlo is the lowest voltage in the total range OV for the standard analog input module and Vhi is the highest voltage in the total range 5V for the standard module These integer values will also be returned when accessing the analog inputs by the API calls in C C or Visual Basic The AO command can also be used to set the analog v
16. Password The RIO can lock out user access to the internal program using the PW and cntrl L cntrl K commands The PW sets the Password for the unit and the cntrl L cntrl K will lock the application program from being viewed or edited The commands ED UL LS and TR will give privilege error 106 when the RIO is ina locked state The program will still run when locked The locked or unlocked state can be burned with the BN command Once the program is unlocked it remains accessible until a lock command or a reset with the locked condition burned in occurs An example of how to lock the program is shown here PW test test LR Test 1 I Locks 0 unlecks LS 2 Tel 106 Privilege violation RIO 47xxx Chapter 5 Programming e 51 Executing Programs Multitasking The RIO can run up to 4 independent programs or threads simultaneously They are numbered 0 thru 3 where 0 is the main thread The main thread differs from the others in the following ways 1 Only the main thread thread 0 may use the input command IN 2 When interrupts are implemented for command errors the subroutines are executed in thread 0 However for the ININTn subroutines the RIO has the ability to execute multiple input interrupts ININTn on designated threads not limited to the main thread For more information refer to the II command in the Command Reference To begin execution of the various programs use the following instruction XQ A n
17. Read Exception Status Description Modbus function code 07 is a request to read the 8 exception status outputs This will read digital outputs O 7 of an RIO configured as a slave Operating as a master The function code of the response can be queried with the MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response _MW results in 07 _MW results in 87 _MW l contains 01 or 02 When using the MB command with Modbus function code 07 response data will be stored in the array referenced in the command line Ways to use function code 7 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 7 Operating as a slave The RIO will accept a read exception status request The RIO will respond with function code 07 and will return 1 byte of output data ranging from 00 to FF with each bit representing the state of a digital output 1 or 0 The LSB of the output data byte is digital output O and the MSB of the output data byte is digital output 7 RIO 47xxx Chapter 3 Communication e 31 Coil Mapping Coil Addresses 0 Digital Output 0 1 Digital Output 1 2 Digital Output 2 3 Digital Output 3 4 Digital Output 4 5 Digital Output 5 6 Digital Output 6 7 Digital Output 7 Examples MBA 7 array Packets Request to read exception statu
18. Sinking Outputs Digital Outputs 8 15 are opto isolated sinking outputs on the RIO 471xx by default none of the digital outputs on the RIO 472xx are configured this way If ordered with 08 15 SOURCE option please see the section below 5 24VDC with 25mA of current capability in a sinking configuration 3 3V 3 3V OUTPOWER L OP1B lt lt gt 10K lt LOAD gt Ki l DO 15 8 LED AE GOZO opi l l 1 OP1A OUTRETURN Figure 5 Low Power Sinking Outputs OP1B should be connected to the positive side of a 5 24VDC external power supply OP1A should be connected to Ground on the external power supply OPIA and OPIB are the Output Power for Bank 1 The output can sink up to 25mA of current The device should be connected between the digital output DO 15 8 and the positive side of the power supply When current is not flowing through the opto coupler CB the 10k resistor pulls up the output pin to the voltage supplied to OP1B When current is flowing through the opto coupler SB the digital output drops to Ground supplied by OP1A and is able to sink up to 25mA of current The bold connections in Figure 5 are external connections OUTC jumpers The OUTC jumpers can be used when an external power supply is not desired for digital outputs 8 15 These low power outputs can use the internal 5V from the RIO instead To do this place a jumper on the pins labeled OUTC as shown here Note These jumpe
19. The command MBA 3 2 4 array results in the following packets being sent when one RIO is the master and another RIO 47100 is the slave communicating over handle A port 502 Modbus When MI is set to 0 the response is given as volts in 32 bit Floating Point When MI is set to 1 the response is given as counts in 16 bit decimal notation Assume analog inputs in ascending order from 0 7 are 4822 9753 1 4673 1 9629 2 4622 2 9675 3 4583 3 9600 Slave MIO Slave MII Request Response Response 32 bit Floating Point Real Value 16 bit Integer Real Value Field Name hex Field Name hex volts Field Name hex counts Function 03 Function 03 Function 03 Starting Address High 00 Byte Count 08 Byte Count 08 Starting Address Low 02 RegVal2 High 3F 0 9753 RegVal2 High 25 9600 Quantity of Registers High 00 79 RegVal2 Low 80 Quantity of Registers Low 04 BO RegVal3 High 32 12904 RegVal2 Low 00 RegVal3 Low 68 RegVal3 High 3F 1 4673 RegVal4 High 3F 16160 BB RegVal4 Low 20 DO RegVal5 High 4C 19480 RegVal3 Low 00 RegVal5 Low 18 With the slave MI set to 0 the master RIO s arrays will look like this array 0 16249 array 1 45056 array 2 16315 array 3 53248 With the slave MI set to 1 the master RIO s arrays will look like this array 0 9600 array 1 12904 array 2 16160 array 3 19480 RIO 47xxx Chapter 3 Communication e 23 Function Code 4 04 Read Input Registers Description Modbus function code 04 is a r
20. array name NOTE Arrays must be defined using the command DM before assigning entry values Examples 66 Chapter 5 Programming RIO 47xxx DM OUTPUT 10 Dimension Output Array OUTPUTI 1 3 Assigns the second element of the array OUTPUT the value of 3 OUTPUT 1 Returns array element value OUTPUT 9 _TIO Assigns the 10th element of the array OUTPUT the value for bank O digital inputs data 2 COS POS 2 Assigns the third element of the array data the cosine of the variable POS multiplied by 2 TIMER 1 TIME Assigns the second element of the array timer the returned value of the TIME keyword Using a Variable to Address Array Elements An array element number can also be a variable This allows array entries to be assigned sequentially using a counter For example Instruction Interpretation FA Begin Program COUNT 0 DM POS 10 Initialize counter and define array LOOP Begin loop WT 10 Wait 10 msec INPUT COUNT TIO Record bank 0 s input bit value into array element INPUT COUNT Report input bit value COUNT COUNT 1 Increment counter JP FLOOP COUNT lt 10 Loop until 10 elements have been stored EN End Program The above example records 10 input bit values for bank O at a rate of one value per 10 msec The values are stored in an array named INPUT The variable COUNT is used to increment the array element counter The above example can also be executed with the automatic data capture feature described
21. below Uploading and Downloading Arrays to On Board Memory Arrays may be uploaded and downloaded using the QU and QD commands QU array start end delim QD array start end where array is an array name such as A Start is the first element of array default 0 End is the last element of array default last element Delim specifies whether the array data is separated by a comma delim 1 or a carriage return delim 0 The file is terminated using lt control gt Z lt control gt Q lt control gt D or Automatic Data Capture into Arrays The RIO provides a special feature for automatic capture of data such as inputs or outputs Up to four types of data can be captured and stored in four arrays The capture rate or time interval may be specified Recording can be done as a one time event or as a circular continuous recording RIO 47xxx Chapter 5 Programming e 67 Command Summary Automatic Data Capture RA n m o p Selects up to four arrays for data capture The arrays must be defined with the DM command RD Selects the type of data to be recorded where typel type2 type3 and typel type2 type3 type4 type 4 represent the various types of data see table below The order of data type is important and corresponds with the order of n m o p arrays in the RA command The RC command begins data collection Sets data capture time interval where n is an integer between and 8 and designates 2 msec between data mis optio
22. ec ecssesccssecssesecneeeecsseeecesecseesecneeseesaeeeeeaecaeeaesneeaes 7 Using Non Galil Communication Software ccccsssscssescssesecssecseesecneeseceaeeceaecseesecaesseesasenesaecateaeeneeaes 7 CHAPTER 3 COMMUNICATION cssssssssssssssssssssssssssssessssssessssessnessssnsesesssesosssssnsssssnessssscssessssessossoeses 10 INTRODUCTION A vous et tan e see ve aaa ken av 10 RS232 PORT koi abri eke beaden e bead klere iya vie eke kika eh kob n es a i a a eki as al cei tee 10 RS 232 Configuration A kan ee ee de e asi 10 ETHERNET CONFIGURATION A ic 10 Communication Pr A aa 10 Jumper Configuration for LOBaseT eee eeesecsessscssesecsecseeecaecseesecsessecsaeecsaecaesecsesseenaeeeeeaecaseneeneeats 11 AA tadas 11 Email from RI tias 12 Communicating with Multiple Devices cece ecsesecsseeceesecseesecneeecesecessecsaeeeessecaeesecneeseesaeeeesaecateseeners 12 Handling Communication Errors oasis neee oen e EEE EE EEVEE Eaa EEEE EE E EE a aa 13 O 13 Unsolicited Message Handling rioen e atan ia 13 Other Protocols Supported eener r eripi eas tir eri 14 MODBUS WITH TAE RIO a sevi ovesise ey esbtisue ske syen s pep swo sa sywos sou pep su diw vyes au gwose saipssetseebeusaebipot cones cvbeesepbiestersensense 14 Raw Modbus Setid RECO1WV 6 eee ursine a ouben Pedi essaye wd deye k anpe pe Se piyon fes TEE ENE ko soap 15 Modbus Read Write to Array Table rsrsrsrsrs avee epeei aree OEE e a sS S 15 Sendine Modb s Packets italia ais iii 15
23. kel a ave E EE ERE 53 RAM Memory Interrogation Commands s ssesesseeseeseeressesesttrteretsseststeteststsstststetsesesteretsesseseererstseeet 53 Operands bek nias oee dic lead Ae SEE dis atte dad ESE 53 Debugging Examplerarnicin a did iaa E E E R N es 53 PROGRAM FLOW COMMANDS ics suet s sn ase eta van kosa vee papa nn daou kone a SEE Ea r eea aa ETE eii iria 54 Inter UDlS iin Bers deba ne innse ieee dalo bwode s EEEE oke E f ea Ne kis rene a ei ede e sab E ESEE AEE 54 Example A eee soti ae kon 55 Conditional I UmMAps sa vote a ae e A i 56 Using If Else and Endif Commands ooooocccococonononnnnoncnnnconcnnncnnn cono nn aa ente ete raaeraanesaessnessnsssossnosanonaoonoonnonnnon 58 Stack Matipolati 4e eee e eee Sizanka fwit a ene fk a e on Ba ab ci ayen ei 59 Atito Start ROULITE kaa take via done kitel pios Red to A kek kep Mi 59 Automatic Subroutines for Monitoring COnditiODS 0 Llrieevettesteotoseosaoonaosoonaoseonnoseoosoonossooonosooouoosose 59 MATHEMATICAL AND FUNCTIONAL EXPRESSIONS ocococonoononncanonnconcnnorononecononnononanancnnonananononnonornan anno nana rininenns 61 Mathematical Operators onnan ote Se tann eee poko ata a 61 BitWise Operators ss vese dents lao e vires cepa ok saa A 63 ECOS aaa dot n to loa ess Ya ao ta ked val dw Po pare a ka ak fa hash date Cave E padi ene Epa ER 64 VARIABLES iss atake de ro vay foon e bo daou ou van toke dy e V dotada aii 64 Programmable Vat ables sss foi e e saf ete
24. master and another RIO 47100 is the slave communicating over handle A port 502 Modbus When MI is set to O the response is given as volts in 32 bit Floating Point When MI is set to 1 the response is given as counts in 16 bit decimal notation Assume analog outputs in ascending order from 0 7 are 5 1 1 5 2 2 5 3 3 5 4 Slave MIO Slave MII Request Response Response 32 bit Floating Point Real Value 16 bit decimal Real Value Field Name hex Field Name hex volts Field Name hex counts Function 04 Function 04 Function 04 Starting Address High 00 Byte Count 08 Byte Count 08 Starting Address Low 02 RegVal2 High 3F 1 0000 RegVal2 High 4C 19661 Quantity of Registers High 00 80 RegVal2 Low CD Quantity of Registers Low 04 00 RegVal3 High 66 26214 RegVal2 Low 00 RegVal3 Low 66 RegVal3 High 3F 1 5000 RegVal4 High 80 32768 CO RegVal4 Low 00 00 RegVal5 High 99 39321 RegVal3 Low 00 RegVal5 Low 99 With the slave MI set to 0 the master RIO s arrays will look like this array 0 16256 array 1 0 array 2 16320 array 3 0 With the slave MI set to 1 the master RIO s arrays will look like this array 0 19661 array 1 26214 array 2 32768 array 3 39321 26 Chapter 3 Communication RIO 47xxx Function Code 5 05 Write Single Coil Description Modbus function code 05 is a request to write a single coil This will write a digital output of an RIO configured as a slave Operating as a master The function code of the respo
25. place in the program where the interrupt had occurred If it is desired to return to somewhere else in the program after the execution of the ININTn subroutine the Zero Stack ZS command is used followed by unconditional jump statements Note When using multiple II commands in a program each II command must point to a unique label and must activate on an unused thread Two or more II commands cannot be set to execute on the same thread nor can multiple II commands be pointed to the same ININTn label Please see the II command in the RIO 47xxx command reference for more details 54 Chapter 5 Programming RIO 47xxx Examples MG Loop stops RIO ININT2 MG Blinker stops WT10000 RI1 1 Interrupt Instruction Interpretation FA Program Label XQ B 1 Execute B in thread 1 111 0 1823 ININTI in thread O when input 1 low and input 3 high T12 1 5 amp 10 ININT2 in thread 1 when input 5 low and input 10 high AT 13 amp 14 Trippoint on inputs 13 and 14 LOOP JP LOOP Pseudo program Loop indefinitely EN End program B Program Label AI 7 amp 8 Trippoint on inputs 7 and 8 LOOP2 SB10 Set bit 10 high WT500 Wait for half a second CB10 Set bit 10 low WT500 Wait for 500msec JP LOOP2 Create a light blinker effect EN End program ININTI Input interrupt program label Print message saying loop program in main thread halted Return to main program without restoring trippoint but keeping the interrupt enabled Print
26. the program space use the interrogation command LS List Program To list the application program labels only use the interrogation command LL List Labels Operands In general all operands provide information that may be useful in debugging an application program Below is a list of operands that are particularly valuable for program debugging To display the value of an operand the message command may be used For example since the operand _ED contains the last line of program execution the command MG _ED will display this line number _ED contains the last line of program execution useful to determine where program stopped _DL contains the number of available labels 62 max _UL contains the number of available variables 126 max _DA contains the number of available arrays 6 max _DM contains the number of available array elements 400 max Debugging Example The following program has an error It attempts to set bit 14 high but SD is used as the command instead of SB When the program is executed the RIO stops at line 001 The user can then query the RIO board using the command TC1 The RIO responds with the corresponding explanation Instruction Interpretation LS List Program 000 HA Program Label RIO 47xxx Chapter 5 Programming e 53 001 SD14 Set bit 14 high 002 SB15 Set bit 15 high 003 MG DONE Print message 004 EN End XQ A Execute A 2001 SD14 Error on Line 1 TC1 Tell Err
27. used with the XQ command in the following format 60 Chapter 5 Programming RIO 47xxx XQ _ED2 or _ED3 _ED1 1 Where the 1 at the end of the command line indicates a restart therefore the existing program stack will not be removed when the above format executes The following example shows an error correction routine that uses the operands Example Command Error w Multitasking Instruction Interpretation FA Begin thread 0 continuous loop JPHA EN End of thread 0 B Begin thread 1 N 17 Create new variable SBN Set the 17th bit an invalid value TY Issue invalid command EN End of thread 1 FCMDERR Begin command error subroutine IF _TC 6 Tf error is out of range SB 8 N 1 Set N to a valid number XQ ED2 ED1 1 ENDIF Retry SB N command IF _TC 1 If error is invalid command TY XQ _ED3 _ED1 1 Skip invalid command ENDIF EN End of command error routine Example Ethernet Communication Error This simple program executes in the RIO and indicates via the serial port when a communication handle fails By monitoring the serial port the user can re establish communication if needed Instruction Interpretation FLOOP Simple program loop JP LOOP EN TCPERR Ethernet communication error auto routine MG P1 _1A4 Send message to serial port indicating which handle did not receive proper acknowledgment RE Return to main program Note The TCPERR routine only detects the loss of TCP IP Ethernet handles not UDP
28. 0001 000E If MI is set to 1 register data is count in 16 bit decimal the RIO will accept a write multiple registers request with an address range of 0000 0007 The RIO will respond with function code 16 a 2 byte starting address field identical to the starting address field of the request packet and a 2 byte quantity of registers field identical to the quantity of registers field of the request packet RIO 47xxx Chapter 3 Communication e 35 Galil Register Map Register Address 32 Bit Floating Point Counts 0 Analog Output O Analog Output 0 1 Analog Output 1 2 Analog Output 1 Analog Output 2 3 Analog Output 3 4 Analog Output 2 Analog Output 4 5 Analog Output 5 6 Analog Output 3 Analog Output 6 7 Analog Output 7 8 Analog Output 4 9 10 Analog Output 5 11 12 Analog Output 6 13 14 Analog Output 7 15 Examples For the following example array contains 0 0 0 0 0 15 1 16 0 2 0 4 8 64 160 0 0 64 64 0 0 MBA 1 21 array Request to write 5V to analog output 1 and 3V to analog output 2 For the following example array contains 40A0 0000 4040 0000 40A00000 is 32 bit Floating Point for 5 0000 decimal and 40400000 is 32 bit Floating Point for 3V decimal MBA 16 2 4 array AO1001 5 Request to write 5V to analog output 1 Request to write 5V to analog output 1 and 3V to analog output 2 36 Chapter 3 Communication RIO 47xxx Packets The command MBA 16 2 4 array results in
29. 1000 AN 2 21 r3 1000 AN 3 21 r4 1000 AN 4 21 r5 1000 AN 5 21 REM calculate deg C r r0 JS Celcius TcO r r1 JIS Celcius Tcl r r2 JS Celcius Tc2 r r3 JSKCelcius Tc3 r r4 JSKCelcius Tc4 r r5 JS Celcius Tc5 Tc AT 100 wait 100 ms from last time ref JP Calc aaaan Celcius sqrt SOR 992137 445376 761 2471 r Tc 25613 43488 sqrt 7 569408 REM adjust for Tc lt 0 deg C IF Tc lt 0 Ta Tc 100 Tc Tc 239062873 536 Tc la Ta 0 2311 Tc Tc Ta ENDIF EN 96 A1 SCB 48206 RIO 47xxx A2 SCB 48306 48316 Description The SCB 48306 and the SCB 48316 Signal Conditioning Board interface to up to 6 thermocouples The SCB 483x6 boards are designed to work with the RIO 4712x The SCB 48316 provides thermocouple terminal connectors for the 6 thermocouple inputs the SCB 48306 provides screw terminals inputs for the 6 thermocouple inputs Both SCB boards provide screw terminal connections for Analog inputs 6 and 7 AI6 7 all 8 analog outputs AO0 7 and two GND terminals The SCB 48306 can plug directly into the Analog 26 pin high density D sub connector and will use Analog inputs 0 5 on the RIO for the 6 thermocouple inputs TC 0 5 AI O 5 It is oriented vertically from the RIO connector as shown in Figure 14 Other mounting options are available upon request By default the SCB
30. 120 Remote I O controller with 10V analog I O 12bit RIO 47120 16 Remote I O controller with 10V analog I O 16bit 26 pin D high density male to screw terminals ICS 48026 M j Use 1 for each RIO 471x0 to break out analog signals ICS 48044 M 44 pin D high density male to screw terminals Use 1 for each RIO 471x0 to break out analog signals SCB 48206 26 pin D high density Signal Conditioning Board interfaces to up to six RTDs Resistive Temperature Device SCB 48306 26 pin D high density Signal Conditioning Board provides interface for up to six thermocouples CABLE 44M 1M 44 pin D high density male cable to discrete wires Use 1 for each RIO 471x0 to break out analog signals 1M 1 meter length Order 2M for 2 meter length CABLE 26M 1M 26 pin D high density male cable to discrete wires Use 1 for each RIO 471x0 to break out analog signals RIO 47xxx Appendix e 89 List of Other Publications 1 Step by Step Design of Motion Control Systems by Dr Jacob Tal Motion Control Applications by Dr Jacob Tal Motion Control by Microprocessors by Dr Jacob Tal Contacting Us Galil Motion Control 270 Technology Way Rocklin CA 95765 Phone 916 626 0101 Fax 916 626 0102 E Mail Address support galilmc com URL www galilmc com 90 Appendix RIO 47xxx Training Seminars Galil a leader in motion control with over 500 000 controllers working worl
31. 8 aeina ra a E ASe na ra EaR E ERE AN E Ea ERE T RV Raa 81 CONNECTORS FORRIOD ATI e 83 44 pin D Sub Connector RIO 471 XX cece eeeseeseesecneeeeceseeecsecaeesecnevsecsaeecesaecaeesecneeseesesaeeaeenaeeeeaeeaeeess 83 26 pin D Sub Connector RIO 4 71 XX eeeeceesecneeeecsseeecesecseesecseesecnaesccsaeceesaecaeesecnecaeeseenasseesaeeeeeeeaees 83 screw Terminals RIO 4 72 xX AA vicdencuusaddeupvussntcenteopudaeencevcvece sandeorsiee cetera 84 J2 RS 232 Port DB 9 Pin Male ss ics sul oa 84 JI Ethernet Port 10 100 Base T RJ 45 oooooooccnococonononnccnoonnnconnnnnnnoonnnccnnnnnnnonnnnnnnn nn nc nono nn nino nn nr non nnnnnnnnnos 85 J5 Power 2 pin Mole ni E 85 JUMPER DESCRIPTION FOR RIO tett tyeke needs ur kt sote diou g aa desa e pop E A E kote bes yo Rca 86 RIO DIMENSION Si bene ea pa ke tye e e 87 RIOSA TAK bain bwi e atan eben sivik ek b bin boo ka pa pk a ae neh osi oke ead 87 ROA TAKS ked ii ai E pe bz ad e a n i ei A eee 88 RIO 47xxx Contents e iii ACCESSORTESAND OPTIONS A a boca 89 LISTOF OTHER PUBLICATIONS 0 cria 90 CONTACTING US dd la 90 TERAINING SEMINARS aii 91 WARRANTS a 92 AU SCB 48206 ei coccion ainia did IAEA AAA ASES E T R se iudeswdsdecssedeosvbesedeessidesasstesssocsies 93 DESCRIPTION Su A kata n Ea eB En ae ea Ta ls Oba tc OE one E E isa 93 SPECIFICATION Soasi E ka e eB es cde a TE Be Be haat tee e kek ses ets 94 WIRING soi ad A A aa Sr eee ek die ki a Be dwe ae e a do Mave iat aa Kore eee tess 94 OP
32. 92 Appendix RIO 47xxx Al SCB 48206 Description The SCB 48206 Signal Conditioning Board interfaces to up to six 3 wire RTD s Resistive Temperature Device The SCB 48206 is designed to work with the RIO 4712x The SCB 48206 plugs directly into the Analog 26 pin high density D sub connector and will use Analog Inputs 0 5 on the RIO for the 6 RTD inputs RTD 0 5 AI 0 5 Tt is oriented vertically from the RIO connector as shown in Figure 12 Other mounting options are available upon request Figure 12 RIO 47122 with SCB 48206 1 Analog inputs 0 5 will not be available for general use analog inputs when the SCB 48026 is connected to the RIO RIO 47xxx A1 SCB 48206 e 93 Specifications Number of Inputs 6 RTD inputs RTD input Analog Input Map RTD 0 5 AI 0 5 Output Range 0 5V Excitation Current 1 mA Input Range 18 230 Q Temperature Range 100 Q RTD 200 to 350 deg C 1 If greater than 2300 350 deg C is required contact Galil Wiring The SBC 48206 has qty 6 3 wire RTD inputs The RTD is wired directly to the screw terminals as indicated in Figure 13 below 1 EXCITE 2 SENSE ma Lo 3 COMMON Figure 13 RTD wiring to SBC 48206 Operation The SBC 48206 will send a 0 5V analog voltage to the RIO that is related to the resistance of the RTD When using the SBC 48026 the analog inputs should be set to 0 5V inputs for the 6 RTD inputs This is done with the AQ command wit
33. B is set to a negative value the analog output will be held at its current value and the PID s will be held constant when the feedback is within the range set by the DB command This mode is preferable for many fluid and temperature control applications 48 Chapter 4 1 0 RIO 47xxx Chapter 5 Programming Overview The RIO provides a versatile programming language that allows users to customize the RIO board for their particular application Programs can be downloaded into the RIO memory freeing up the host computer for other tasks However the host computer can send commands to the RIO at any time even while a program is being executed In addition to commands that handle I O the RIO provides commands that allow it to make decisions These commands include conditional jumps event triggers and subroutines For example the command JP LOOP n lt 10 causes a jump to the label LOOP if the variable n is less than 10 For greater programming flexibility the RIO provides user defined variables arrays and arithmetic functions The following sections in this chapter discuss all aspects of creating applications programs The RIO 47xx0 program memory size is 200 lines x 40 characters The RIO 47xx2 increases the memory size to a total of 400 lines x 40 characters Editing Programs Use Galil software to enter programs in the Editor window After downloading a program use the XQ command to execute the program The RIO also has an int
34. EN amp FF000000 1000 Let variable LEN6 fourth byte of LEN 000 MG LEN6 S4 Display LENG as string message of up to 4 chars MG LENS S4 Display LENS as string message of up to 4 chars MG LEN4 S4 Display LEN2 as string message of up to 4 chars MG LEN3 S4 Display LEN as string message of up to 4 chars MG LEN2 S4 Display LEN as string message of up to 4 chars MG LENI S4 Display LEN as string message of up to 4 chars EN This program will accept a string input of up to 6 characters parse each character and then display each character Notice also that the values used for masking are represented in hexadecimal as denoted by the preceding For more information see the section on Sending Messages page 69 To illustrate further if the user types in the string TESTME at the input prompt the RIO will respond with the following Response from command MG LEN6 S4 Response from command MG LENS S4 Response from command MG LEN4 S4 Response from command MG LEN3 S4 Response from command MG LEN S4 Response from command MG LEN S4 meaunmey RIO 47xxx Chapter 5 Programming e 63 Functions I RND Round of n Rounds up if the fractional part of n is 5 or greater SQR n Square root of n Accuracy is 004 IN n Return digital input at general input n where n starts at 0 OUT Return digital output at general output n where n starts at 0 AN n Re
35. ERATION votas or ti tac e Ett Aa a Ba dad dt te aba Ree Geta ikea yes 94 Method Lit Da da vev ao asi O td iaa Ds hu BOR Re 95 Method Vs ts ib dane ao ede CREB ia de id ita ee BE RIES 96 AZE SCB 48306 483 1G snicscccscccscsassacscetsesescteshiclededeseueceshavtcecdesesetsuavsededesesecssnavtecvdesetocsbavtecedesssseavesscdevevesssetets 97 DESCRIPTION da 97 SPECIFICATIONS ie a e e LLE Laa e a a pact ese ae on 98 WARING rd a a DE a a A Ret NN a a a A 98 OPERATION A Pe e Le o en dd 99 TINDEX A O ERROR BOOKMARK NOT DEFINED iv Contents RIO 47xxx Chapter 1 Overview Introduction Derived from the same fundamentals used in building the Galil motion controllers the RIO 47xxx is a programmable remote I O controller that conveniently interfaces with other Galil boards through its Ethernet port The RIO is programmed exactly the same way as a DMC Digital Motion Controller with the exception of a few revised commands and the removal of all motion related commands Communication with the RIO even works the same way as with other Galil controllers and it utilizes the same software programs Interrogation commands have been included to allow a user to instantly view the entire I O status VO hardware or Ethernet handle availability see the TZ ID and TH commands The purpose of an RIO board is to offer remote I O in a system and the ability to synchronize complex events To do this the RIO consists of two boards a high speed processor w
36. Explanation of Status Information ccccesccesecsceesceeseeseceeceeceseeesecesecsaecsaecaeecaeeeseceneeeeeesseeereneeeeeenaes 40 A N O A O 41 INTRODUCTION kw resen codos i p ene da fe eet onc SE ESen SEE d ke Eta ako boo ko boo Ad did ns does 41 SPECIFICATIONS susie dh contas dois apik ken sd ano abode seny sa ias add k dl de S E S dan dat TEA ade da 41 Digital Outputs 0 A A i 41 Digital puts ti ini 43 Analog OUI PUIS ein ria 44 Analog IMPUS ii rad 45 Analog Process Control Loop ii A aa 46 CHAPTER 5 PROGRAMMING ooooccoonoonnconnconnonnnonnnonononncnnncnnncnoconoonnconncon cono nonn non nono conc connc noc nconnconncon nooo nono oss 49 OVERVIEW iaa 49 EDITING PROGRAMS lt a ic 49 PROGRAM FORMA Torrico da aa 49 Using Labels in Programs comisionada 50 Special Labels iio ia 50 Commenting Program ciao io alas 50 Program Lines Greater than 40 Characters sccscsssssscscssscsseeecesecseesecaeesecnasecsaeeaeaecaeeseenaeeeeaeeneeeeseaees 51 Lock Program Access using Password ooooononcconononcnonconnnonnnnnnonnconoco nono ao onaoonaosaoososeoooooooooosoosooooooonooonooonoon 51 EXECUTING PROGRAMS MULTITASKINGo ocoocconcnnccnnonocononnnnnnnoncnnnnnnorononennnonnoncranan nono nonerononnancrnnan cana nanerininenns 52 DEBUGGING PROGRAMS ie cod ctestasces Eene ease eaS oa SEREEN aE es SEE di tea Aedes dadas ATE S ERRA ess 52 Trace C mmandS anore eea a bale a e a EE a wo a a E e Po a a E EE 53 Error Code Command ve wk oaae die E a E ea
37. F and ELSE commands Nesting IF Conditional Statements The RIO allows for IF conditional statements to be included within other IF conditional statements This technique is known as nesting and the RIO allows up to 255 IF conditional statements to be nested This is a very powerful technique allowing the user to specify a variety of different cases for branching Command Format IF ELSE and ENDIF Condition IF conditional statement s Execute commands proceeding IF command up to ELSE command if conditional statement s is true otherwise continue executing at ENDIF command or optional ELSE command Optional command Allows for commands to be executed when argument of IF command evaluates not true Can only be used with IF command ENDIF Command to end IF conditional statement Program must have an ENDIF command for every IF command Example using IF ELSE and ENDIF Instruction Interpretation TEST Begin Main Program TEST LOOP Begin loop inside main program 58 Chapter 5 Programming RIO 47xxx TEMP IN 1 I IN 2 JSHCOND TEMP 1 JP LOOP EN COND IF QIN 1 0 IF IN 2 0 MG INPUT 1 AND INPUT 2 ARE INACTIVE ELSE MG ONLY INPUT 1 IS ACTIVE ENDIF TEMP is equal to 1 if either Input 1 or Input 2 is high Jump to subroutine if TEMP equals 1 Loop back if TEMP doesn t equal 1 End of main program Begin subroutine COND IF conditional statement based on input 1 2 IF conditional statemen
38. Gumper OFF The jumper labeled 19 2 also located at JP5 for the RIO 471xx and JP2 for the RIO 472xx allows the user to select the serial communication baud rate The baud rate can be set using the following table BAUD RATE OFF 115k 19 2k Step 2 Connecting Power to the RIO Since the RIO can be powered using either a 18 36V DC power input or a PoE Power over Ethernet switch there are two possible connection options shown here 1 EXT 18 36VDC power input is the default configuration The four jumpers on JP6 for the RIO 471xx and JP1 for the RIO 472xx Apply a DC power supply in the range of 18 36V to the 2 pin molex connector The RIO 472xx has screw terminal power connectors marked 18 36 and RET in lieu of the molex connector The power supply should be capable of delivering up to 4 Watts The RIO uses Molex Pitch Mini Fit Jr Receptacle Housing connectors for connecting DC Power For more information on the connectors go to http www molex com Note The part number listed below is the connector that is found on the controller For more information see the Molex website http www molex com VDC 18 36V DC GROUND Molex Part Number Pin Part Number x2 Type 39 31 0020 44476 3112 2 Position Warning Damage can occur if a supply larger than 36VDC is connected to the board 2 PoE Power over Ethernet This configuration needs the four jumpers on JP6 for the RIO 471xx and JP1 for the RIO 472
39. O turns the trace function off Note When the trace function is enabled the line numbers as well as the command line will be displayed as each command line is executed The program lines come back as unsolicited messages Error Code Command When a program error occurs the RIO halts the program execution at the point of the error To display the last line number of program execution issue the command MG ED The user can obtain information about the type of error condition that occurred by using the command TC1 This command returns a number and text message which describe the error condition The command TCO or TC will return the error code without the text message For more information about the command TC see the Command Reference RAM Memory Interrogation Commands For debugging the status of the program memory array memory or variable memory the RIO has several useful commands The command DM will return the number of array elements currently available The command DA will return the number of arrays that can be currently defined For example the RIO has a maximum of 400 array elements in up to 6 arrays If a single array of 100 elements is defined the command DM will return the value 250 and the command DA will return 5 To list the contents of the variable space use the interrogation command LV List Variables To list the contents of array space use the interrogation command LA List Arrays To list the contents of
40. O14 15 with PWM option Vo Output Voltage Range OV to 3 3V Io Current output Sink Source 5 mA Max 3 3V DO 15 14 Figure 9 PWM option For the standard low power digital outputs found on the RIO 471xx the bandwidth is 50 Hz Part number ordering example RIO 47102 PWM HS This option changes digital input 3 DI3 to a high speed digital input It is available on the RIO 47xxx as a standard option With this option the input becomes a TTL level input that is differential with respect to digital input 2 DI2 is not available as an input with the HS option The maximum frequency of pulses that can be captured is increased to 3Mhz If higher values are required please consult factory 3 3V 4 99K IN_3 DNI 1 5K MAX3490 IN_2 Figure 10 HS Option Part number ordering example RIO 47100 HS 16Bit The 16 option specifies 16 bit resolution on the analog inputs and outputs This option is valid on the RIO 4712x and RIO 472xx only 80 Appendix RIO 47xxx Part number ordering example RIO 47120 16bit AI 10v12Bit This option changes the analog inputs on the RIO 472xx to accept 10V analog signals with 12 bit resolution The range of the analog inputs can be changed with the AQ command similar to the RIO 4712x Part number ordering example RIO 47200 AI_10v12bit AL 10v16Bit This option changes the analog inputs on the RIO 472xx to accept 10V analog signals with 16 bit resolution The ran
41. OF PROGRAM Note The NO command also works to comment programs The inclusion of the apostrophe or NO commands will require process time by the RIO board Using REM Statements with the Galil Terminal Software When using Galil software to communicate with the RIO REM as in remark statements may also be included REM statements begin with the word REM and may be followed by any comments that are on 50 Chapter 5 Programming RIO 47xxx the same line The Galil terminal software will remove these statements when the program is downloaded to the RIO board For example OUTPUT REM PROGRAM LABEL SB1 CB2 REM Set Bit 1 and Clear bit 2 EN REM END OF PROGRAM Since the REM statements will be removed when the program is downloaded to RIO be sure to keep a copy of the program with comments stored on the PC Program Lines Greater than 40 Characters Line Continuation Character A new character ascii character 96 has been included to allow a command in an application program to extend beyond the confines of the 40 character maximum line length TEST IF var100 100 amp var101 50 MG Condi tion satisfied ELSE MG Stop ENDIF EN This allows for a more efficient command compressing b the continuation of message commands MG on multiple lines c Longer IF JP amp JS conditional statements Note the total length of a multi line command can not exceed 80 characters Lock Program Access using
42. ROGRAMMABLE VO ses aeter poo vouch ETNE EE a e ne rob EE EEEE poko apen TE ba payen pes 72 Digital Output s m na olores 72 Digital ImputSicuceantan sao lt ate aaa TEE mes ons 73 Analog Mputa e A at Sa alien he 73 Analog Outputs sve ente eo nan dala lon ioe kaa ko ee ees ale aoa eae Wolk Sane 74 REAL TIME CLOCK one a a a ica 74 APPENDIX ON 75 ELECTRICAL SPECIFICATIONS ci duvt koton pont kayo wood ese as a dav kapa espo ouap as po ceuvenssdnbanesecsveurcsisescesheierncesese 75 TAP uit OPUS r 75 Power Requirements A A pa e bas ao po a ya etan 75 PERFORMANCE SPECIFICATIONS s oneer day eat ooo none ko ka tiende ins 76 RIO AT a ies an e e ie ce a ee ke en RAS Seat neh dee Se 76 RIQ A PRD feet ie bw da A ae 76 CERTIFICATIONS herrens ro s feet bo da ee cearo ky VIE EERTE padan kep oka oo va anana ese vas ae ske ok eye EERE E 76 EL A ira 76 CE SE a 76 ROHS tessa osorno olas oia 76 STANDARD OPTIONS uote coupsheetes 77 ADIN a le ooo miele 77 NO ABI MA PAEA dina al Gao kan kou abi aa 77 ALL ia tion lata 77 A O AE ileso ki Sepa ron rial ia 77 08 15 SOURCE GLSRC OPLUON 2 conil Ao o lili 78 0 7 01 8 15 SINK SOURCB sinaloa asi 78 QUAD amd SSL A nae 78 PM Mist aio ek S Di sp teria beens 79 HS fist eee edie ee ohana NN NAO 80 O eee eee 80 AT AOVI2BIt stesso ioe iain nee ee cl ed sn a ee ae 81 Al A0VIGBIt hiss e cai enan adore f k cn nee in ne Ain haa 81 ALMA wise tad day eee a da ei eke aa ko adalat nana ge ee 81 AO Option SCB 4860
43. Where A represents the label and n indicates the thread number To halt the execution of any thread use the instruction HXn where n is the thread number Note that both the XQ and HX commands can be performed from within an executing program For example Instruction Interpretation TASK1 Task1 label ATO Initialize reference time CB1 Clear Output 1 FLOOP1 Loop label AT 10 Wait 10 msec from reference time SB1 Set Output 1 AT 40 Wait 40 msec from reference time then initialize reference CBI Clear Output 1 JP FLOOP1 Repeat Loop1 TASK2 Task2 label XQ TASKI1 1 Execute Task1 LOOP2 Loop label WT20000 Wait for 20 seconds HXI Stop thread 1 MG DONE Print Message EN End of Program The program above is executed with the instruction XQ TASK2 0 which designates TASK2 as the main thread i e Thread 0 TASK1 is executed within TASK2 Debugging Programs The RIO provides commands and operands that are useful in debugging application programs These commands include interrogation commands to monitor program execution determine the state of the RIO 52 Chapter 5 Programming RIO 47xxx board and the contents of the program array and variable space Operands also contain important status information which can help to debug a program Trace Commands The trace command causes the RIO to send each line in a program to the host computer immediately prior to execution Tracing is enabled with the command TR1 TR
44. a serial port or ethernet Ways to use function code 2 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 2 3 GIN see IN in the command reference Operating as a slave The RIO will accept a read discrete inputs request with a starting address ranging from 0000 000F referencing digital inputs 0 15 The RIO will accept a request for up to all 16 of its digital inputs with a quantity of inputs range of 0001 0010 The RIO will respond with a byte count of either 01 or 02 which describes the number of bytes of digital inputs being returned byte count quantity of inputs 8 if the remainder is not 0 byte count quantity of inputs 8 1 The RIO will respond with a input status of 1 or 2 bytes equal to the byte count ranging from 0001 FFFF with each bit representing the state of a digital input 1 or 0 The LSB of the first input status byte refers to the input addressed by the request packet Coil Mapping Coil Addresses Coil Addresses 0 Digital Input 0 8 Digital Input 8 1 Digital Input 1 9 Digital Input 9 2 Digital Input 2 10 Digital Input 10 3 Digital Input 3 11 Digital Input 11 4 Digital Input 4 12 Digital Input 12 5 Digital Input 5 13 Digital Input 13 6 Digital Input 6 14 Digital Input 14 7 Digital Input 7 15 Digital Input 15 RIO 47xxx Chapter 3 Communication e 19 Examples MBA 2 2 12 array Request the st
45. a single RS232 connection for sending and receiving commands from a PC or other terminal The pin outs for the RS232 connection can be found in the Appendix J5 Power 2 pin Molex RS 232 Configuration Configure the PC for 8 data bits no parity one stop bit and hardware handshaking The baud rate for the RS232 communication defaults to 115k baud but can be set to 19 2k baud by placing a jumper on J5 The serial port has a 4 bytes FIFO Handshaking Modes The RS232 port is configured for hardware handshaking In this mode the RTS and CTS lines are used The CTS line will go high whenever the RIO is not ready to receive additional characters The RTS line will inhibit the RIO board from sending additional characters Note The RTS line goes high for inhibit This handshake procedure is required and ensures proper communication especially at higher baud rates Ethernet Configuration Communication Protocols The Ethernet is a local area network through which information is transferred in units known as packets Communication protocols are necessary to dictate how these packets are sent and received The RIO supports two industry standard protocols TCP IP and UDP IP The board will automatically respond in the format in which it is contacted 10 Chapter 3 Communication RIO 47xxx TCP IP is a connection protocol The master must be connected to the slave in order to begin communicating Each packet sent is acknowledged when receive
46. alent to the Internet client and the term slave is equivalent to the Internet server An Ethernet handle is a communication resource within a device The RIO 47xx0 can have a maximum of 3 Ethernet handles open at any time This number is increased to 5 Ethernet handles on the RIO 47xx2 If all handles are in use and another device tries to connect it will be sent a reset packet showing that the RIO cannot establish any new connections NOTE A reset will cause the Ethernet connection to be lost There are a number of ways to reset the board Hardware resets push reset button or power down RIO board and software resets through Ethernet or RS232 by entering the RS command When the RIO acts as the master the IH command is used to assign handles and connect to its slaves The IP address may be entered as a 4 byte number separated with commas industry standard uses periods or as a signed 32 bit number A port number may also be specified but if it is not it will default to 1000 The protocol TCP IP or UDP IP to use must also be designated at this time Otherwise the board will not 12 Chapter 3 Communication RIO 47xxx connect to the slave Ex IHB 151 25 255 9 lt 179 gt 2 This will open handle 2 and connect to the IP address 151 25 255 9 port 179 using TCP IP Once the IH command is used to connect to slaves the user can communicate to these slaves by sending commands to the master The SA command is used for t
47. alilmc com products ce_documents rio47000_ce_dc pdf ROHS ROHS Compliant 76 Appendix Standard Options The RIO 47xxx can be ordered in many different configurations and with different options This section provides information regarding the different options available on the RIO 47xxx For more information on pricing and how to order an RIO with these options see our RIO 47xxx part number generator on our website http www galilmc com products rio 47xxx part number php DIN If ordered with the DIN option the RIO has a DIN rail mount attached to the case This option is valid for all RIO 471xx controllers It is not valid for the RIO 472xx family as the RIO 472xx comes in a DIN rail mount by default Part number ordering example RIO 47100 DIN NO DIN This option is only valid with the RIO 472xx This option removes the din rail clips The unit will still be in a plastic tray Part number ordering example RIO 47200 NO DIN 422 This option allows the RIO to communicate via RS 422 instead of RS 232 Pin Number Description Pin Number Description 1 RTS 6 RTS 2 TXD 7 TXD 3 RXD 8 RXD 4 CTS 9 CTS 5 GND Part number ordering example RIO 47100 422 RTC The RIO 471x2 provides a real time clock feature RTC provides an extended feature set Real time clock RIO 471x2 RIO 471x2 RTC RT providing Hours Minutes Second
48. annel 6 counts UW Analog In Channel 7 counts UW Output State UW Input State UL Pulse Count SL ZC data user configurable variable SL ZD data user configurable variable Note UB Unsigned Byte UW Unsigned Word 2 bytes of Little Endian SL Signed Long Word These may be signed or unsigned words depending on the AQ setting on the RIO 4712x For example if the bytes received from the data record packet for analog input O were 00 80 it could have the following meaning depending on AQ RIO 47xxx Chapter 3 Communication e 39 Little Endian AQO 1 AQ0 2 AQ0 3 AQ0 4 80 00 5 Volts 10 Volts 2 5 Volts 5 Volts This data can be broken up into sections The Data Record Map includes the 4 bytes of header The General Data Block consists of the sample number the error code and the general status The I O Data Block includes all the other items in the above table Explanation of Status Information Header Information Bytes 0 1 of Header The first two bytes of the data record provide the header information BIT 15 BIT 14 BIT 13 BIT 12 BIT 11 BIT 10 BIT 9 BIT 8 1 N A N A N A N A N A N A N A BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0 N A N A N A N A N A N A N A N A Bytes 2 3 of Header Bytes 2 and 3 make up a word which represents the Number of bytes in the data record including the header Byte 2 i
49. ao E dy A ae ano swen aa soon e tetas sosyalis 64 OPERAN DS cin ace 65 Examples of Internal Vanables mutante san kebek ae epok 65 Special Operands Keywords uticciaaio posicion es 66 ARRA VS o a ove oka ao E ko yok a ao ben akou pos eben too ao os po boko on den oka aaa osans ones abese ES 66 ii Contents RIO 47xxx Definini ATA Si A A eens 66 Assignment of Array Entries ui ie 66 Using a Variable to Address Array Elements scceeescesceseescesecseesecneesccsseceescsaeceeeaecaeeseeneseeesaeeneeners 67 Uploading and Downloading Arrays to On Board MemMOlY ccoconccnncnconnconoconccnnonnnonononononn non nnnncnnn canon recono 67 Automatic Data Capture into Arrays aiiora eeren a a nono nonn enano a a on none a a a on cnn nana Eas 67 D allocAtng ATray pate po whee cti 68 INPUT OF DATA NUMERIC AND STRING cccssssccesssscecessececssceecsssaececseseececseeecsesaeeecsssaecesseeeessesaeeesseaeeeens 69 JW ONI ee ti aewop ken nek kan ob kon Day popi kok koka yon fk DS o E aban ieee pabon aebies 69 OUTPUT OF DATA NUMERIC AND STRING cccsscecssssececsscceceeeececseseececseeeecsesseeecsesaececseseeceeaeeecsesaeeeeseeeeeees 69 Sending Mesas cnt aiii lacio rola 69 Displaying Variables and ArrayS ccescceseceseesseeseeeseesecesecesceesecseceaeceaecnaecaeecaecaaecaeecaeeeaeseeeeeseeeeeneeeneees 71 Formatting Variables and Array Elements cccccscesssessceesceeseesecesecseceaecenecaeecaeeeseeeneeeeceseeeneeeneeeneesaes 71 P
50. ation on actual hardware and review it with Galil specialists TIME Two days 8 30 am 5 00 pm RIO 47xxx Appendix e 91 WARRANTY All products manufactured by Galil Motion Control are warranted against defects in materials and workmanship The warranty period for all products is 18 months except for motors and power supplies which have a year warranty In the event of any defects in materials or workmanship Galil Motion Control will at its sole option repair or replace the defective product covered by this warranty without charge To obtain warranty service the defective product must be returned within 30 days of the expiration of the applicable warranty period to Galil Motion Control properly packaged and with transportation and insurance prepaid We will reship at our expense only to destinations in the United States Any defect in materials or workmanship determined by Galil Motion Control to be attributable to customer alteration modification negligence or misuse is not covered by this warranty EXCEPT AS SET FORTH ABOVE GALIL MOTION CONTROL WILL MAKE NO WARRANTIES EITHER EXPRESSED OR IMPLIED WITH RESPECT TO SUCH PRODUCTS AND SHALL NOT BE LIABLE OR RESPONSIBLE FOR ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES COPYRIGHT 2008 The software code contained in this Galil product is protected by copyright and must not be reproduced or disassembled in any form without prior written consent of Galil Motion Control Inc
51. atus of discrete inputs 2 13 result is stored in array MG IN 1002 Requests the status of input 2 result is transmitted via serial port or ethernet Packets The command MBA 2 2 12 array results in the following packets being sent when one RIO is the master and another RIO is the slave communicating over handle A port 502 Modbus Assume digital inputs in descending order from 15 0 are 0 1 1 1 0 0 1 1 0 0 1 1 0 1 1 1 Request Response Field Name hex Field Name hex Function 02 Function 02 Starting Address High 00 Byte Count 02 Starting Address Low 02 Inputs Status 9 2 CD Quantity of Inputs High 00 Inputs Status 13 10 OC Quantity of Inputs Low 0C 1 Byte of Response Word bit 7 6 5 4 3 2 1 0 Input 9 8 7 6 5 4 3 2 Value 1 1 0 0 1 1 0 1 2 Byte of Response Word bit 15 14 13 12 11 10 9 8 Input X X X X 13 12 11 10 Value 0 0 0 0 1 1 0 1 Note bits in the response marked X are not valid input response data but are instead 0 s that fill the remainder of the byte Inputs report back a 0 when active and a 1 when inactive On the master RIO array 0 205 and array 1 12 after the MBA 2 2 12 array command is issued 20 Chapter 3 Communication RIO 47xxx Function Code 3 03 Read Holding Registers Description Modbus function code 03 is a requ
52. controller For more information see the Molex website http www molex com 18 36VDC Molex Part Number Pin Part Number x2 Type 39 31 0020 44476 3112 2 Position RIO 47xxx Appendix e 85 Jumper Description for RIO JPS MRST Master Reset enable Returns RIO to factory default settings and erases non volatile memory Requires power on or RESET to be activated E AAPP corrupt ll MON TI O Set baud Rate to 19 2k default without jumper is 115k po JOPTr 10BaseT Ethernet Communication JP6 AUX Power for board comes from 2pin Molex Connector 18 36V DC 4 jumpers JP7 PoE Power for board comes from Power over Ethernet No power cable 4 jumpers is necessary Ethernet cable with PoE Switch is required Label Function If jumpered JP102 Connects INCO amp INC1 to 5V and INCOB amp INCIB to GND JP102 OUTC Connects OP1A to GND and OP1B to 5V 86 Appendix RIO 47xxx RIO Dimensions RIO 471xx PWR ENK ERR ICA aja DIGITAL DoE Epos sanoo 30 OPOA Moor polla bos 29 DO2 Doda Ebo 43003 28005 19 D04 Dosa apboti 42 DO6 27 OPOB 12 DO7 pode bot 41 NIC 11 OPIA DOs a apot3 40009 0208 sg nor posa Epo14 Loa DOM ober DOTA Lapos 38D015 240014 op1g ana apr a7inco ZNC ron as ora apra 3Dp PH son EE oa apro 21 DIA e pay jee 35 DIS 5 DI6 2 55 paol apra 34NC P anc S glee 4 20 DIS apr3 33018 PIC 3 prg Solezl s Diga Apri4 wort
53. d If no acknowledgement is received the information is assumed lost and is resent Unlike TCP IP UDP IP does not require a connection This protocol is similar to communicating via RS232 If a cable is unplugged the device sending the packet does not know that the information was not received on the other side Because the protocol does not provide for lost information the sender must re send the packet Galil recommends using TCP IP for standard communication to insure that if a packet is lost or destroyed while in transit it will be resent However UDP is recommended in certain situations such as launching Data Record information to a host for graphing or data collection Each packet must be limited to 470 data bytes or less This is not an issue when using Galil software as the Galil Ethernet driver will take care of the low level communication requirements The IK command blocks the controller from receiving packets on Ethernet ports lower than 1000 except for ports 0 23 25 68 80 and 502 To receive packets on all ports set IK to 0 NOTE In order not to lose information in transit Galil recommends that the user wait for an acknowledgement of receipt of a packet before sending the next packet Jumper Configuration for 10BaseT If 10BaseT communication is required a jumper must be placed on the pins labeled OPT The default is no jumper which is 100BaseT Ethernet communication Addressing There are three levels of address
54. d DQ will be in effect upon power up To understand how a Process Control Loop works on the RIO consider an example where it is desirable to control the temperature of an oven The key items needed to do this are a heater a temperature sensor the oven itself and a RIO unit to control the process As shown in the diagram below the heating element is coupled to the System which in this case is the oven The temperature sensor provides feedback to the RIO in the form of an analog input The RIO unit then compares the desired set point entered by the PS command with the temperature sensor The difference between the two is called the error E The error goes through a PID digital filter and then through a Digital to Analog Converter DAC which outputs a control voltage to the heater to close the loop 46 Chapter 4 1 0 RIO 47xxx RIO 47100 Temperature Sa Setpoint ps kn e PID Digital DAC pa Heater System ki PS si gt S o p gt i Filter ADC A Ks O AN Temperature Feedback Sensor Volts Figure 7 Process Control Loop RIO 47xxx Chapter 4 I O e 47 The example program below uses analog input O as the feedback from the temperature sensor and analog output O as the control voltage to the heater An update rate of 25msec was set using the CL command but a slower update rate could have been chosen due to the slow nature of temperat
55. d as the Pulse Counter Input unless the HS option is ordered Analog Outputs RIO 4710x Analog Outputs 0 7 on the RIO 4710x are 12 bit analog outputs and have a voltage range of 0 SVDC The outputs can sink or source up to 4mA of current RIO 4712x Analog Outputs 0 7 on the RIO 4712x have a configurable voltage range that is set using the DQ command The default outputs have a 12bit DAC resolution order RIO 4712x 16 for 16 bit resolution The analog outputs can sink or source up to 4mA of current See the DQ command in the Command Reference for a full explanation DQ Analog Output Range DQ 0 1 Sets AOO to 0 5VDC DQ 1 2 Sets AO1 to 0 10VDC DQ 2 3 Sets AO2 to 5VDC DQ 3 4 Sets AO3 to 10VDC 44 Chapter 4 1 0 RIO 47xxx Analog Inputs Each analog input goes through its own internal ADC Analog to Digital Converter but when differential mode is chosen the inputs are treated as pairs The difference of two analog inputs is the value reported by the controller The same analog value is reported on both pairs of inputs The table below shows how the differential channels are grouped For instance if ANO is at 1 5 VDC and AN1 is at OVDC a value of 1 5V is reported on G AN 0 and AN 1 Here s the equation used to get the analog value for a sample pair of inputs 0 and 1 AI _ value InputO Inputl RIO 4710x Analog Inputs 0 7 have a voltage range of 0 5VDC They hav
56. data on the RIO Up to 1000 elements are available in the RIO 471x2 and 400 in the RIO 47xx0 Each element is accessible as a 16 bit unsigned integer Modbus register 1xxx OR as a 32 bit floating point number Modbus registers 2XXxX See the ME command in the RIO Command Reference for further details Sending Modbus Packets The RIO programming language provides 3 ways of issuing Modbus packets as a master 1 Issue the MB command of type Mbh 1 len array This Galil command allows the user complete control over the creation of their Modbus packet len is the number of bytes to be included in the packet and array is the name of the array containing the Modbus packet 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 2 Issue the MB command of type Mbh addr x m n array This Galil command allows the user to send a Modbus command easily by allowing the user to select a few key parameters and allowing the controller to do the rest addr is the Unit ID field which if not set Galil will automatically set to the value of the handle the communication is over Handle A 01 B 02 etc Also as a slave the RIO ignores the Unit ID field x is the function code of the Modbus command m is the address at which to begin reading or writing n is either the
57. diagram is shown in Figure 4 3 3V 3 3V OUTPOWER OPOA 1 2A L S PX S gt Do A Ji SA L Do 7 0 LED YA x ka CPU N RE N MMBD1204 10K LOAD gt ki OPOB 4 OUTRETURN Figure 4 High Power Sourcing Outputs OPOA should be connected to the positive side of a 12 24VDC external power supply OPOB should be connected to Ground on the external power supply OPOA and OPOB are the Output Power for Bank 0 The device that needs to be turned on off solenoid relay etc should be connected with the positive side of the device connected to the digital output DO 7 0 and the negative side connected to the Ground of the power supply When the SBn Set Bit n command is RIO 47xxx Chapter 4 I O e 41 given this will provide a positive voltage to the device on the output pin to turn it on with up to 500mA of current available A CBn Clear Bit n will remove the voltage to turn it off The bold connections in Figure 4 are external connections RIO 471xxx There are two internal 2 Amp fuses for the high power outputs one fuse for outputs 0 3 and another fuse for outputs 4 7 These fuses are not field replaceable RIO 472xx OPIA and OP1B are the Output Power for Bank 1 digital outputs 8 15 There are two internal 4 Amp fuses for the high power outputs one fuse for outputs 0 7 OPOA OPOB and another fuse for outputs 8 15 OP1A OP1B These fuses are not field replaceable Low Power
58. dwide has a proud reputation for anticipating and setting the trends in motion control Galil understands your need to keep abreast with these trends in order to remain resourceful and competitive Through a series of seminars and workshops held over the past 15 years Galil has actively shared their market insights in a no nonsense way for a world of engineers on the move In fact over 10 000 engineers have attended Galil seminars The tradition continues with three different seminar each designed for your particular skill set from beginner to the most advanced MOTION CONTROL MADE EASY WHO SHOULD ATTEND Those who need a basic introduction or refresher on how to successfully implement servo motion control systems TIME 4 hours 8 30 am 12 30 pm ADVANCED MOTION CONTROL WHO SHOULD ATTEND Those who consider themselves a servo specialist and require an in depth knowledge of motion control systems to ensure outstanding controller performance Also prior completion of Motion Control Made Easy or equivalent is required Analysis and design tools as well as several design examples will be provided TIME 8 hours 8 00 am 5 00 pm PRODUCT WORKSHOP WHO SHOULD ATTEND Current users of Galil motion controllers Conducted at Galil s headquarters in Rocklin CA students will gain detailed understanding about connecting systems elements system tuning and motion programming This is a hands on seminar and students can test their applic
59. e 12bit ADC a resolution of approximately 1 22mV with a 100k input impedance Depending on the hardware configuration the AQ command behaves differently Check the ID command to see what style of RIO hardware is installed AQ Differential Pairs AQ 0 1 Input 0 amp Input 1 AQ 2 1 Input 2 amp Input 3 AQ 4 1 Input 4 amp Input 5 AQ 6 1 Input 6 amp Input 7 Table 1 Differential Analog Input Channels on RIO 4710x RIO 4712x The default resolution for the RIO 4712x is 12bit with a 16bit option The part number is RIO 4712x 16 for the 16 bit version Input Impedance Single Ended 42k Q Differential 31k Q Use the AQ command to specify the analog input range on the RIO 4712x AQ Input Range AQ 0 1 Set input O to have 5V input range AQ 1 2 Set input to have 10V input range AQ 2 3 Set input 2 to have 0 5V input range AQ 3 4 Set input 3 to have 0 10V input range Table 2 Setting Input Ranges on RIO 4712x On the RIO 4712x the AQ command also allows the RIO to change the configuration from the default 8 single ended analog inputs to 4 differential analog inputs AQ Differential Pairs AQ 0 1 Input 0 amp Input 1 and 5V input range AQ 2 2 Input 2 amp Input 3 and 10V input range AQ 4 3 Input 4 amp Input 5 and 0 5 V input range AQ 6 4 Input 6 amp Input 7 and 0 10V input range Table 3 Di
60. e RIO will accept a request with a quantity of registers field up to 0008 if MI is set to 0 and 00010 if MI is set to 1 The RIO will respond with a byte count ranging from 0000 to 0010 if MI is 1 and from 0000 to 0020 if MI is O byte count 2 NumberOfRegisters where NumberOfRegisters is equal to the number of analog outputs you are trying to read multiplied by 2 if MI is 0 or 1 if MI is 1 The RIO will respond with an input registers field consisting of either 2 bytes counts or 4 bytes 32 bit floating point per analog output register in ascending order from the analog output referenced in the address 24 Chapter 3 Communication RIO 47xxx Galil Register Map Register Address 32 Bit Floating Point Counts 0 Analog Output O Analog Output 0 1 Analog Output 1 2 Analog Output 1 Analog Output 2 3 Analog Output 3 4 Analog Output 2 Analog Output 4 5 Analog Output 5 6 Analog Output 3 Analog Output 6 7 Analog Output 7 8 Analog Output 4 9 10 AnalogOutput 5 11 12 Analog Output 6 13 14 Analog Output 7 15 Examples MBA 4 2 4 array MG AO 1002 Request the status of Registers 2 5 AOI and AO2 if MIO and AO2 AO3 AO4 AOS if MI1 The response is stored in array Requests the status of analog output 2 result is transmitted via ethernet or serial RIO 47xxx Chapter 3 Communication e 25 Packets The command MBA 4 2 4 array results in the following packets being sent when one RIO is the
61. eger number that represents the analog voltage For a RIO 47100 the equation used to determine the decimal equivalent of the analog voltage is as follows N V Vlo 4095 Vhi Vlo 8 Where N is the integer equivalent of the analog voltage V is the expected analog voltage Vlo is the lowest voltage in the total range OV for the standard analog input module and Vhi is the highest voltage in the total range 5V for the standard module The data range for N is 0 32760 These integer values will also be returned when accessing the analog inputs by the API calls in C C or Visual Basic The AQ command also configures the analog inputs to be either 8 single ended default or 4 differential inputs The AA command is a trippoint that halts program execution until the specified voltage on an analog input is reached The third field of the AA command controls whether the trippoint will be satisfied when going higher or lower than the voltage With a command such as AA 1 4 5 0 if the specified voltage is exceeded prior to arrival at the AA command the program will continue to execute without a pause Analog inputs are useful for reading special sensors such as temperature tension or pressure The range of AA is dependant on the AQ setting Here are some examples of using the Analog inputs RIO 47xxx Chapter 5 Programming e 73 Instruction Instruction JP C AN 1 gt 2 Jump to A if analog input number 1 is greater than 2 volts MGOAN 2
62. ent draw is 10mA each When then 0 5V analog outputs are ordered the 12V terminals will be No Connects Part number ordering example RIO 47200 SAO 10v12bit Qty 8 10V configurable analog outputs with 12 bit resolution 82 Appendix RIO 47xxx Connectors for RIO 47xxx 44 pin D Sub Connector RIO 471xx Description Description Description Digital Input 15 No Connect INCIB Digital Input 14 Digital Input 12 Digital Input 13 Digital Input 11 Digital Input 9 Digital Input 10 Digital Input 8 No Connect Input Common DI 8 15 No Connect INCOB Digital Input 6 Digital Input 7 Digital Input 5 Digital Input 3 Digital Input 4 Digital Input 2 Digital Input 0 Digital Input 1 Input Common DI 0 7 5 24V Output Power Supply for DO 8 15 No Connect Digital Output 15 Digital Output 13 Digital Output 14 Digital Output 12 Digital Output 10 Digital Output 11 Digital Output 9 Output Power Ground for DO 8 15 3 Digital Output 8 No Connect Digital Output 7 Output Power GROUND for DO 0 7 Digital Output 6 Digital Output 4 Digital Output 5 Digital Output 3 Digital Output 1 Digital Output 2 Digital Output 0 12 24V Output Power Supply for DO 0 7 12 24V Output Power Supply for DO 0 7 Note INCOB and INC1B are only valid when INC jumpers are used
63. equest to read input registers In its default configuration the RIO 471x0 responds to this command with analog output register information To configure the RIO to respond to a function code 4 request with analog input information see the MV command in the command reference Operating as a master The function code of the response can be queried with the MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response _MW results in 04 _MW results in 84 _MW 1 contains 01 or 02 When using the MB command with Modbus function code 04 response data will be stored in the array referenced in the command line When using EAO AO contains the response data which can either be stored to a variable or transmitted via serial port or ethernet Ways to use function codel with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 4 3 AO see AO in the command reference Operating as a slave The RIO will accept different address ranges for a read input registers request depending on the state of the MI command If MI is set to O register data is volts in 32 bit floating point the RIO will accept a read input registers request with an address range of 0000 000E If MI is set to 1 register data is counts in 16 bit decimal The RIO will accept a read input registers request with an address range of 0000 0007 Th
64. ernal editor that may be used to create and edit programs in the RIOs memory The internal editor is a rudimentary editor and is only recommended when operating with Galil s DOS utilities or through a simple RS 232 communication interface such as Windows Hyperterminal See the ED command in the Command Reference for more info Program Format A RIO program consists of instructions combined to solve a programmable logic application Action instructions such as setting and clearing I O bits are combined with Program Flow instructions to form the complete program Program Flow instructions evaluate real time conditions such as elapsed time or input interrupts and alter program flow accordingly A delimiter must separate each RIO instruction Valid delimiters are the semicolon or carriage return The semicolon is used to separate multiple instructions on a single program line where the maximum number of characters on a line is 40 including semicolons and spaces A line continuation character below the on a standard keyboard allows a command to be continued on the next line in the case that 40characters is not enough for a single command see example at the end of this section RIO 47xxx Chapter 5 Programming e 49 Using Labels in Programs All RIO programs must begin with a label and end with an End EN statement Labels start with the number sign followed by a maximum of seven characters The first character must be a le
65. es that define Ethernet devices The first is the MAC or hardware address This is a unique and permanent 6 byte number No other device will have the same MAC address The RIO MAC address is set by the factory and the last two bytes of the address are the serial number of the board To find the Ethernet MAC address for a RIO unit use the TH command A sample is shown here with a unit that has a serial number of 3 Sample MAC Ethernet Address 00 50 4C 28 00 03 The second level of addressing is the IP address This is a 32 bit or 4 byte number that usually looks like this 192 168 15 1 The IP address is constrained by each local network and must be assigned locally Assigning an IP address to the RIO board can be done in a number of ways The first method for setting the IP address is using a DHCP server The DH command controls whether the RIO board will get an IP address from the DHCP server If the unit is set to DH1 default and there is a DHCP server on the network the controller will be dynamically assigned an IP address from the server Setting the board to DHO will prevent the controller from being assigned an IP address from the server The second method to assign an IP address is to use the BOOT P utility via the Ethernet connection The BOOT P functionality is only enabled when DH is set to 0 Either a BOOT P server on the internal network or the Galil software may be used When opening the Galil Software it will respond with a list o
66. ess field which matches the starting address field of the request packet and a quantity of outputs which matches the quantity of outputs field of the request packet RIO 47xxx Chapter 3 Communication e 33 Coil Mapping Coil Addresses Coil Addresses 0 Digital Output O 8 Digital Output 8 1 Digital Output 1 9 Digital Output 9 2 Digital Output 2 10 Digital Output 10 3 Digital Output 3 11 Digital Output 11 4 Digital Output 4 12 Digital Output 12 5 Digital Output 5 13 Digital Output 13 6 Digital Output 6 14 Digital Output 14 7 Digital Output 7 15 Digital Output 15 Examples For the following example array contains 0 0 0 0 0 9 1 15 0 0 0 16 2 AA 55 MBA 1 15 array Request to write AA55 to digital outputs 15 0 For the following example array contains SAA55 MBA 15 0 16 array Request to write AA55 to digital outputs 15 0 Packets The command MBA 15 0 16 array when array contains AA55 results in the following packets being sent when one RIO is the master and another RIO is the slave communicating over handle A port 502 Modbus The slave RIO s outputs 15 0 will be set to the following 1 is on 0 is off Output 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Value 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 Request Response Field Name hex Field Name hex Function 15 Funct
67. est to read holding registers In its default configuration the RIO 471x0 responds to this command with analog input register information To configure the RIO to respond to a function code 3 request with analog output information see the MV command in the command reference Operating as a master The function code of the response can be queried with the MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response _MW results in 03 _MW results in 83 _MW l contains 01 or 02 When using the MB command with Modbus function code 03 response data will be stored in the array referenced in the command line When using EAN G AN contains the response data which can either be stored to a variable or transmitted via serial port or ethernet Ways to use function code 3 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 3 3 AN see AN in the command reference Operating as a slave The RIO will accept different starting address ranges for a read holding registers request depending on the state of the MI command If MI is set to 0 register data is volts in 32 bit floating point the RIO will accept a read holding registers request with an address range of 0000 000E If MI is set to 1 register data is counts in 16 bit decimal The RIO will accept a read holding registers request with an address range of
68. ever and numbers are permitted in the rest of the name Spaces are not permitted Variable names should not be the same as RIO instructions For example RS is not a good choice for a variable name Examples of valid and invalid variable names are Valid Variable Names STATUSI 64 Chapter 5 Programming RIO 47xxx TEMPI POINT Invalid Variable Names REALLONGNAME Cannot have more than 8 characters 123 Cannot begin variable name with a number STAT Z Cannot have spaces in the name Assigning Values to Variables Assigned values can be numbers internal variables and keywords functions RIO board parameters and strings the range for numeric variable values is 4 bytes of integer 2 followed by two bytes of fraction 2 147 483 647 9999 Numeric values can be assigned to programmable variables using the equal sign Any valid RIO functions can be used to assign a value to a variable For example s1 ABS V2 or s2 IN 1 Arithmetic operations are also permitted To assign a string value the string must be in quotations String variables can contain up to six characters that must be in quotation Examples INTWO _TI2 Assigns returned value from TI2 command to variable INTWO INPUT IN 1 Assigns logical value of input 1 to variable INPUT V2 V14 V3 V4 Assigns the value of V1 plus V3 times V4 to the variable V2 Var CAT Assign the string CAT to variable Var Displaying the value of variables at the terminal Variab
69. f all RIO boards and controllers on the network that do not currently have IP addresses The user must select the board and the software will assign the specified IP address to it This address will be burned into the controller BN internally to save the IP address to the non volatile memory Note if multiple boards are on the network use the serial numbers to differentiate them CAUTION Be sure that there is only one BOOT P or DHCP server running If your network has DHCP or BOOT P running it may automatically assign an IP address to the RIO board upon linking it to the network In order to ensure that the IP address is correct please contact your system administrator before connecting the I O board to the Ethernet network RIO 47xxx Chapter 3 Communication e 11 The third method for setting an IP address is to send the IA command through the RS 232 port Note The IA command is only valid if DHO is set The IP address may be entered as a 4 byte number delimited by commas industry standard uses periods or a signed 32 bit number e g IA 124 51 29 31 or IA 2083724575 Type in BN to save the IP address to the RIO non volatile memory NOTE Galil strongly recommends that the IP address selected is not one that can be accessed across the Gateway The Gateway is an application that controls communication between an internal network and the outside world The third level of Ethernet addressing is the UDP or TCP port number The Gali
70. f5 9 Tc5 5 32 AT 100 wait 100 ms from last time reference JP Calc This method provides a relatively accurate temperature reading with a simple and straight forward calculation A limitation with this method is that it uses an idealized relationship between the impedance of an RTD and the temperature of the RTD In reality the relationship between impedance and temperature is not linear so if higher precision is required from the temperature reading the following Method should be used RIO 47xxx A1 SCB 48206 e 95 Method 2 This method uses the following equations to calculate the temperature of the RTD These equations more accurately describe the relationship between temperature and impedance of the RTD than Method 1 For Tc gt 0 deg C R t gt 100 R t Ro 1 A Te B Te For Tc lt 0 deg C R 9 lt 100 R t Ro 1 A Tc B Te C Te 100 Tc Where R t Resistance of RTD Ro 100 Q A 3 9083 10 deg C B 5 775 107 deg C C 4 183 10 deg C Below is an example program for using Method 2 that could run on the RIO 4712x Note The coefficients have been modified to avoid round off errors in the calculations in the temperature readings MAIN REM set Analog inputs 0 5 to 0 5V inputs AQ 0 3 AQ 1 3 AQ 2 3 AQ 3 3 AQ 4 3 AQ 5 3 ATO set initial time reference Calc REM calculate resistance of RTD r0 1000 AN 0 21 rl 1000 AN 1 21 r2
71. fferential Analog Input Channels on RIO 4712x RIO 47xxx Chapter 4 I O e 45 RIO 472xx The default resolution for the RIO 472xx is 12 bit with a 16 bit option The part number is RIO 472xx 16 for the 16 bit version Input Impedance default 12 bit Single Ended 100kQ Input Impedance With 10V option Single Ended 42k Q Differential 31k Q See the AQ command in the command reference for a full explanation Analog Process Control Loop A Process Control Loop allows closed loop control of a process or device The RIO 471x0 has two independent PID filters to provide process control of two devices simultaneously The RIO 471x2 has a total of 6 PID loops available The default configuration for the RIO 472xx has no analog outputs and therefore 0 PID loops If the RIO 472xx is ordered with analog outputs then it will have 2 PID loops available The set of commands shown in the table below are used to set the structure of the Process Control Loop Command Description AF Analog Input for feedback AZ Analog Output for control KP Proportional Gain KD Derivative Gain KI Integral Gain IL Integrator Limit DB Deadband CL Control Loop Update Rate PS Commanded Setpoint TE Tell Error AQ Analog Input Range DQ Analog Output Range Note All PID parameters are burnable except PS DB AQ and DQ If you issue a BN with the PID s enabled the default values for PS DB AQ an
72. ge of the analog inputs can be changed with the AQ command similar to the RIO 4712x Part number ordering example RIO 47200 AI 10v16bit 4 20mA This option installs resistors in parallel with each analog input On RIO s with 0 5V analog input ranges the resistor is 1000 ohms and on RIO s with 10V analog input ranges the resistor value is 475 ohms 1 An RIO with 10V analog inputs should be configured for O 10V range AQ n 4 With this setting the range for 4 20mA will be 1 9V 9 5V The equation for calculating the current is Tna 2 105 V Where Ima current in mA V Voltage reading from RIO Part number ordering example RIO 47120 4 20mA AO Option SCB 48608 The RIO 47200 by default does not have analog outputs however analog outputs can be added using the AO option When analog outputs are added a new screw terminal board is added called the SCB 48608 and is attached to the RIO 47200 at the factory cannot be installed in the field This board supplies 8 analog outputs to the RIO 47200 The option can be ordered with 10V configurable analog outputs in either 12 or 16 bits same as RIO 4712x or with 0 5V analog outputs 12 bit resolution same as RIO 4710x See the DQ command for specifics on the 10V configurable options Figure 11 SCB 48608 RIO 47xxx Appendix e 81 The 12V terminals will provide 12V output only when the outputs are ordered as 10V configurable outputs Maximum curr
73. h a setting of 3 AQ n 3 where n 0 5 The calculation for the resistance of the RTD from the analog voltage is given from the following equation R 1000 V 21 Where R Resistance of RTD V Analog Read from RIO There are 2 methods for calculating the temperature once the resistance of the RTD has been calculated Note The following calculations assume an RTD with Ro 100 Q and a 0 00385 Platinum RTD 94 Al SCB 48206 RIO 47xxx Method 1 This method strictly uses the RTD coefficient and assumes a proportional relationship between impedance and temperature The equation for this is given in the following equation Tc R Ro a 100 Where Tc Temperature in deg C Ro 100 Q a 0 00385 Below is an example program for using Method 1 that could run on the RIO 4712x MAIN REM set Analog inputs 0 5 to 0 5V inputs AQ 0 3 AQ 1 3 AQ 2 3 AQ 3 3 AQ 4 3 AQ 5 3 ATO set initial time reference Calc REM calculate ANA of RTD rO 1000 RAN 0 21 ri 1000 AN 1 Dei r2 1000 AN 2 21 r3 1000 AN 3 21 r4 1000 AN 4 21 r5 1000 AN 5 21 REM calculate Ad G Tc0 r0 100 0 385 Tel r1 100 0 385 Tc2 r2 100 0 385 Tc3 r3 100 0 385 Tc4 r4 100 0 385 Tc5 r5 100 0 385 REM calculate deg F not required T O 9 Tc0 5 32 Tf1 9 Tc1 5 32 Tf2 9 Tc2 5 32 T 3 9 Tc3 5 32 Tf4 9 Tc4 5 32 T
74. haracters until the hardware handshake allows characters to be sent CW 1 Other Protocols Supported Galil supports DHCP ARP BOOT P and Ping which are utilities for establishing Ethernet connections ARP is an application that determines the Ethernet hardware address of a device at a specific IP address BOOT P is an application that determines which devices on the network do not have an IP address and assigns the IP address you have chosen to it Ping is used to check the communication between the device at a specific IP address and the host computer The RIO can communicate with a host computer through any application that can send TCP IP or UDP IP packets A good example of this is Telnet a utility that comes standard with the Windows operating system When using DHCP and a DNS Domain Name Server the DNS will assign the name RIO47100 n to the controller where n is the serial number of the unit Modbus with the RIO The RIO 47xxx supports Modbus TCP and requires an Ethernet connection between its master or slave devices As a Modbus class 1 device the RIO supports the following Modbus function codes Function Code Modbus Description Galil Description 1 Read Coil Status Read Digital Outputs 2 Read Input Status Read Digital Inputs 3 Read Holding Registers Read Analog Inputs 4 Read Input Registers Read Analog Outputs 5 Force Single Coil Write Digital Output 6 Preset Single Regis
75. has occurred The _MW1 command see the command reference can be used to query the exception code 16 Chapter 3 Communication RIO 47xxx Function Code 1 01 Read Coils Description Modbus function code 01 is a request to read coils This will read digital outputs from an RIO configured as a slave Operating as a master The function code of the response can be queried with the MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response MW results in 01 _MW results in 81 _MW l contains 01 or 02 When using the MB command with Modbus function code 1 response data will be stored in the array referenced in the command line When using OUT OUTT contains the response data which can either be stored to a variable or transmitted via serial port or ethernet Ways to use function code 01 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function codel 3 GOUTI see EOUT in the command reference Operating as a slave The RIO will accept a read coils request with a starting address ranging from 0000 000F referencing digital outputs 0 15 The RIO will accept a request for up to all 16 of its digital outputs with the quantity of coils ranging from 0001 0010 The RIO will respond with function code 01 followed by a byte count of either 01 or 02 which describes the number of bytes of digital o
76. hat both statements be true for the combined statement to be true The l 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 parentheses for proper evaluation by the RIO In addition the RIO executes operations from left to right For example using variables named V1 V2 V3 and V4 JP TEST V1 lt V2 amp V3 lt V4 In this example this statement will cause the program to jump to the label TEST if V1 is less than V2 and V3 is less than V4 To illustrate this further consider this same example with an additional condition JP TEST V1 lt V2 amp V3 lt V4 V5 lt V6 This statement will cause the program to jump to the label TEST under two conditions 1 If V1 is less than V2 AND V3 is less than V4 OR 2 If V5 is less than V6 Using the JP Command If the condition for the JP command is satisfied the RIO branches to the specified label or line number and continues executing commands from this point If the condition is not satisfied the RIO board continues to execute the next commands in sequence Instruction Interpretation RIO 47xxx Chapter 5 Programming e 57 JP Loop COUNT 10 Jump to Loop if the variable COUNT is less than 10 JS MOVE2 GIN 1 1 Jump to subroutine MOVEZ2 if input 1 is logic level high After the subroutine MOVE is executed the program sequencer returns to the main program location
77. his purpose and it has the following syntax SAh command string Here command string will be sent to handle h For example SAA XQ command will send an XQ command to the slave server on handle A A more flexible form of the command is SAh field1 field2 field3 field4 field8 where each field can be a string in quotes or a variable When the Master client sends an SA command to a Slave server it is possible for the master to determine the status of the command The response _IHh4 will return the number 1 to 4 1 indicates waiting for the acknowledgement from the slave 2 indicates a colon command accepted has been received 3 indicates a question mark command rejected has been received 4 indicates the command timed out If a command generates multiple responses such as the TE command the values will be stored in SAh0O thru _SAhn where n is the last field If a field is unused its SA value will be 2431 See the Command Reference for more information on the SA command Which devices receive what information from the RIO depends on various things If a device queries the RIO it will receive the response unless it explicitly tells the RIO to send it to another device If the command that generates a response is part of a downloaded program the response will route to whichever port is specified by the CF command either a specific Ethernet handle or the RS232 port If the user wants to send the message to a port other than
78. iables can be formatted using the specifier Sn where n is the number of characters 1 thru 6 For example MG STR S3 RIO 47xxx Chapter 5 Programming e 69 This statement returns 3 characters of the string variable named STR Numeric data may be formatted using the Fn m expression following the completed MG statement n m formats data in HEX instead of decimal The actual numerical value will be formatted with n characters to the left of the decimal and m characters to the right of the decimal Leading zeros will be used to display specified format For example MG The Final Value is RESULT F5 2 If the value of the variable RESULT is equal to 4 1 this statement returns the following The Final Value is 00004 10 If the value of the variable RESULT is equal to 999999 999 the above message statement returns the following The Final Value is 99999 99 The message command normally sends a carriage return and line feed following the statement The carriage return and the line feed may be suppressed by sending N at the end of the statement This is useful when a text string needs to surround a numeric value Example A FNAME John LNAME Smith MG The name is FNRAME S3 N MG LNAME S6 EN When A is executed the above example will appear on the screen as The name is John Smith Using the MG Command to Configure Terminals The MG command can be used to configure a terminal Any ASCII cha
79. ion 15 Starting Address High 00 Starting Address High 00 Starting Address Low 00 Starting Address Low 00 Quantity of Outputs High 00 Quantity of Outputs High 00 Quantity of Outputs Low 10 Quantity of Outputs Low 10 Byte Count 02 Outputs Value High AA Outputs Value Low 55 34 Chapter 3 Communication RIO 47xxx Function Code 16 10 Write Multiple Registers Description Modbus function code 10 is a request to write multiple registers also known as analog outputs Operating as a master The function code of the response can be queried with the _MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response _MW results in 10 _MW results in 90 _MW l contains 01 or 02 Ways to use function code 16 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 16 3 AO x See command reference for details Note The RIO acting as a master can write up to 123 registers at a time with function code 16 per the Modbus specification The Modbus transaction results are available with the MW and MW1 commands Operating as a slave The RIO will accept different starting address ranges for a write multiple registers request depending on the state of the MI command If MI is set to 0 register data is volts in 32 bit floating point the RIO will accept an address range of
80. ith integrated Ethernet and an T O board consisting of digital inputs digital outputs analog inputs and analog outputs If different I O requirements are required a custom I O board can be made to mate up directly with the RIO processor RIO 47xxx Chapter 1 Overview e 1 Part Numbering Overview Highlights Options RIO 47100 Metal case 0 5V Analog IO 8 high power optoisolated digital outputs 8 low power optoisolated digital outputs 16 optoisolated digital inputs DIN 08 15 SOURCE HS 422 4 20mA PWM RIO 47102 Same as RIO 47100 but with expanded memory DIN 08 15 SOURCE HS 422 4 20mA RTC PWM RIO 47120 Same as RIO 47100 but with 10V analog IO DIN 08 15 SOURCE 16 Bit 422 HS 4 20mA PWM RIO 47122 Same as RIO 47120 but with expanded memory DIN 08 15 SOURCE 16 Bit 422 HS 4 20mA RTC PWM QUAD SSI RIO 47200 Same as RIO 47100 except Screw terminals instead of D Subs Din rail mount with metal cover All 16 outputs are high power No analog outputs use AO option to add analog 422 0 7 SINK or 0 7 SOURCE 8 15 SINK or 8 15SOURCE HS 10V12 Bit 10V16 Bit NO DIN 4 20mA PWM SAO_5v_12bit SAO_10v12bit SAO_10v16bit For details on all the options please see Standard Options in the Appendix 2 Chapter 1 Overview RIO 47xxx RIO 47xx0 vs RIO 47xx2
81. k Contact Galil if a local server is not available e g an Internet Gateway is required to contact NIST See the RTC section in the Appendix for further details and specifications for the real time clock 74 Chapter 5 Programming RIO 47xxx Appendix Electrical Specifications Input Output Digital I O See Chapter 4 DAC Output Current 4mA max output per channel 47120 12V out 10mA max output Power Requirements 18 36 VDC Typical RIO 4710x 1 4W RIO 4712x 2 6W RIO 47200 2 1W Max 4 Watts RIO 47xxx Appendix e 75 Performance Specifications RIO 47xx0 Variable Range 2 billion Variable Resolution 1 10 74 Variable Size 126 variables Array Size 400 elements 6 array names Max Program Labels 62 Program Size 200 lines x 40 characters Maximum Number of Burn Cycles 10 000 BP BN BV combined RIO 47xx2 Variable Range 2 billion Variable Resolution 1 10 74 Variable Size 256 variables Array Size 1000 elements 6 array names Max Program Labels 126 Program Size 400 lines x 40 characters Maximum Number of Burn Cycles 10 000 BP BN BV combined Certifications The RIO 471xx is certified for the following when the product or package is marked ETL ANTERTE 3137106 CONFORMS TO lb UL STD 61010 1 CAN CSA STD C22 2 NO 61010 1 ETLLISTED CERTIFIED TO CE http www g
82. ke decisions without a host computer Command Format JP and JS JS destination logical condition Jump to subroutine if logical condition is satisfied JP destination logical condition Jump to location if logical condition is satisfied The destination is a program line number or label where the program sequencer will jump if the specified condition is satisfied Note that the line number of the first line of program memory is 0 The comma designates IF The logical condition tests two operands with logical operators 56 Chapter 5 Programming RIO 47xxx Logical operators ES TES ES ETE n ET lt ess than or equal to lt gt lt greater than or equal o Conditional Statements The conditional statement is satisfied if it evaluates to any value other than zero The conditional statement can be any valid RIO numeric operand including variables array elements numeric values functions keywords and arithmetic expressions If no conditional statement is given the jump will always occur Examples Number V1 6 Numeric Expression V1 V7 6 ABS V1 gt 10 Array Element V1 lt Count 2 Variable VI V2 Internal Variable _TH 255 _DM lt 100 YO V1 gt IN 2 GIN 1 O Multiple Conditional Statements The RIO will accept multiple conditions in a single jump statement The conditional statements are combined in pairs using the operands and 1 The operand between any two conditions requires t
83. l board does not require a specific port number The port number is established by the client or master each time it connects to the RIO board Typical port numbers for applications are Port 23 Telnet Port 502 Modbus Port 80 HTTP Email from the RIO If the RIO is on a network with a SMTP Mail Server the RIO is capable of sending an email message using the MG command There are three configuration commands necessary to send an email from the RIO unit MA MS and MD MA sets the smtp email server IP address MS sets the email source or from address and MD sets the destination or to address There is a maximum character limit for the MS and MD commands of 30 characters An example of this is shown here MA 10 0 0 1 example SMTP Email Server IP address MD someone example com sample destination email address MS me example com sample source address MG Testing Email M Message to send via Email Please contact your system administrator for information regarding email settings Note it is strongly recommended that the email messaging frequency is limited so as not to overload the email server Communicating with Multiple Devices The RIO is capable of supporting multiple masters or slaves A typical scenario would be connecting a PC a master and a motion controller a 2nd master that can both send commands to the RIO board over Ethernet on different handles Note The term master is equiv
84. l send an analog voltage to the RIO 4712x that is proportional to the temperature of the junction by the Voltage constant defined in the Specifications section When using the SCB 483x6 the analog inputs should be set to 0 5V inputs for the thermocouple inputs This is done with the AQ command with a setting of 3 AQ n 3 where n 0 5 for TC 0 5 The temperature can be determined by using the Voltage constants given in the Specifications section The equation for calculating Temperature in deg C is Temperature deg C AN 0 5 1000 Voltage Constant Where AN 0 5 Analog input readings for TC 0 5 Voltage Constant Voltage constant for SCB 483x6 and thermocouple type is defined in the Specifications section The below code uses analog inputs 0 5 and stores the temperature into array Tc 0 5 written for type K thermocouples MAIN REM Analog inputs 0 5 to 0 5V inputs AQ 0 3 AQ 1 3 AQ 2 3 AQ 3 3 AQ 4 3 AQ 5 3 DM Tc 6 voltK 10 15 mV deg C type K ATO set initial time reference Calc n 0 CalcH Tc n AN n 1000 voltk n n 1 JP CalcH n 6 AT 100 wait 100ms from last time ref JP Calc RIO 47xxx A2 SCB 48306 48316 e 99
85. les may be sent to the screen using the format variable For example Vl returns the value of the variable V1 V1 or MG V1 are also valid ways of displaying a variable Operands Operands allow status parameters of the RIO to be incorporated into programmable variables and expressions Most RIO commands have an equivalent operand which are designated by adding an underscore _ prior to the command see command reference Examples of Internal Variables IN1 CIN 1 Assigns value of input to the variable IN1 JP LOOP AN 0 lt 2 Jump to LOOP if analog input 0 is less than 2 JP ERROR TC 1 Jump to ERROR if the error code equals 1 Operands can be used in an expression and assigned to a programmable variable but they cannot be assigned a value For example _TIO 1 is invalid RIO 47xxx Chapter 5 Programming e 65 Special Operands Keywords The RIO provides a few additional operands that give access to internal variables that are not accessible by standard RIO commands Returns serial of the board Returns the number of available labels for programming Returns the available array memory Returns the number of available variables TIME Free Running Real Time Clock Resets with power on Note TIME does not use an underscore character _ as other keywords All these keywords have corresponding commands except for TIME Examples of Keywords Vl DA Assign V1 the number of available array names
86. ll bits of bank O and 1 OPO 7 Sets output bits O 1 and 2 to one 20 21422 on bank 1 Clears all bits on bank 0 The state of the digital outputs can be accessed with the GOUT n where n is the output number Ex MG OUT 1 displays the state of output number 1 Digital Inputs The digital inputs are accessed by using the IN n function or the TI n command The IN n function returns the logic level of a specified input n where n is the input bit number The IQ command determines the active level of each input The TI n command gives the input status of an entire bank where n is the bank number 0 or 1 The AI command is a trip point that pauses program execution until the specified combination of inputs is high or low Example Using Inputs to control program flow Instruction Instruction JP A IN 1 0 Jump to A if input 1 is low MG IN 2 Display the state of input 2 AI 7 amp 6 Wait until input 7 is high and input 6 is low Analog Inputs Analog inputs are accessed with the AN n function where n is the number assigned to the analog input channel The returned value will be a voltage reading with 12 bit resolution 16bit optional on RIO 47120 The standard voltage range is 0 to 5VDC on the RIO 47100 The voltage input range is configurable on the RIO 47120 using the AQ command Note When analog input values are accessed from the Data Record or from the Record Array function the returned value will be an int
87. meric Data HA IN Enter output number OUT EN In this example the message Enter output number is displayed on the computer screen The RIO board waits for the operator to enter a value The operator enters the numeric value that is then assigned to the variable OUT Inputting String Variables String variables with up to six characters may input using the specifier Sn where n represents the number of string characters to be input If n is not specified six characters will be accepted For example IN Enter X Y or Z V S specifies a string variable of up to six characters to be input Output of Data Numeric and String Numerical and string data can be output from the RIO board using several methods The message command MG can output string and numerical data Also the RIO can be commanded to return the values of variables and arrays as well as other information using the interrogation commands such as V1 and TZ Sending Messages Messages may be sent using the message command MG This command sends specified text and numerical or string data from variables or arrays to the screen Text strings are specified in quotes and variable or array data is designated by the name of the variable or array For example MG The Final Value is RESULT In addition to variables functions and commands responses can be used in the message command For example MG The input is IN 1 Formatting Messages String var
88. message saying blinker effect in thread 1 halted since ININT2 runs in thread 1 Wait 10 seconds for user to reset inputs 5 and 10 Return to thread 1 s main program blinker continues while restoring trippoint on inputs 5 and 10 interrupt disabled Note This multitasking program can be executed with the instruction XQ A 0 designating A as the main thread i e Thread 0 B is executed within A Event Trigger This example waits for input 1 to go low and input 3 to go high and then execute the TZ interrogation command Note The AI command actually halts execution of the program until the input occurs If you do not want to halt the program sequences use the Input Interrupt function II or a conditional jump on an input such as JP GO IN 1 0 IN 3 1 Instruction Interpretation INPUT Program Label AI 1 amp 3 Wait for input 1 low and input 3 high TZ List the entire I O status EN End program RIO 47xxx Chapter 5 Programming e 55 Conditional Jumps The RIO provides Conditional Jump JP and Conditional Jump to Subroutine JS instructions for branching to a new program location based on a specified condition The conditional jump determines if a condition is satisfied and then branches to a new location or subroutine Unlike event triggers such as the AI command the conditional jump instruction does not halt the program sequence Conditional jumps are useful for testing events in real time They allow the RIO to ma
89. mmands The RIO can provide a block of status information back to the host computer in a single Ethernet packet using either the QR or DR commands The QR command returns the Data Record as a single response The DR command causes the controller to send a periodic update of the Data Record out a dedicated UDP Ethernet handle The Data Record response packet contains binary data that is a snapshot of the controller s VO status Since the Data Record response contains all information in binary format the result of this command cannot be displayed in a Galil terminal The QR and DR commands will return 4 bytes of header information followed by an entire data record A data record map is provided below RIO Data Record DATA TYPE ITEM UB 1 byte of header UB 2 byte of header UB 3 byte of header UB 4 byte of header UW Sample number UB Error Code UB General Status UW Analog Out Channel 0 counts UW Analog Out Channel counts UW Analog Out Channel 2 counts UW Analog Out Channel 3 counts UW Analog Out Channel 4 counts UW Analog Out Channel 5 counts UW Analog Out Channel 6 counts UW Analog Out Channel 7 counts UW Analog In Channel 0 counts UW Analog In Channel 1 counts UW Analog In Channel 2 counts UW Analog In Channel 3 counts UW Analog In Channel 4 counts UW Analog In Channel 5 counts UW Analog In Ch
90. mple Command Error Instruction BEGIN IN ENTER THE OUTPUT 0 15 OUT SB OUT JP BEGIN EN CMDERR JP DONE _ED lt gt 3 JP DONE _TC lt gt 6 MG VALUE OUT OF RANGE MG TRY AGAIN ZS 1 JP BEGIN DONE ZSO EN Interpretation Label Input Interrupt on 1 Loop Input Interrupt Send Message to screen Return from interrupt routine to Main Program and do not re enable trippoints Interpretation Begin main program Prompt for output number Set the specified bit Repeat End main program Command error utility Check if error on line 3 Check if out of range Send message Send message Adjust stack Return to main program End program if other error Zero stack End program The above program prompts the operator to enter the output port to set If the operator enters a number out of range greater than 15 the CMDERR routine will be executed prompting the operator to enter a new number In multitasking applications there is an alternate method for handling command errors from different threads Using the XQ command along with the special operands described below allows the controller to either skip or retry invalid commands OPERAND FUNCTION Returns the number of the thread that generated an error _ED2 _ED3 Retry failed command operand contains the location of the failed command Skip failed command operand contains the location of the command after the failed command The operands are
91. n the following packets being sent when one RIO is the master and another RIO is the slave communicating over handle A port 502 Modbus Request Response Field Name hex Field Name hex Function 05 Function 05 Starting Address High 00 Starting Address High 00 Starting Address Low 07 Starting Address Low 07 Output Value High FF Output Value High FF Output Value Low 00 Output Value Low 00 As a result of the MB command above the slave RIO will have output 7 turned on 28 Chapter 3 Communication RIO 47xxx Function Code 6 06 Preset Single Register Description Modbus function code 06 is a request to write to a single register This will write all 16 digital outputs of an RIO configured as a slave Operating as a master The function code of the response can be queried with the _MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response _MW results in 06 _MW results in 86 _MW l contains 01 or 02 Ways to use function code 6 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 6 Operating as a slave The RIO will accept a preset single register request with a starting address of 0000 The register values can range from 0x0000 to OxFFFF and correspond to a binary representation of the 16 digital outputs The RIO will respond with a M
92. nal and specifies the number of elements to be captured If m is not defined the number of elements defaults to the smallest array defined by DM When mis a negative number the recording is done continuously in a circular manner _RD is the recording pointer and indicates the address of the next array element n 0 stops recording Returns a 0 or where 0 denotes not recording specifies recording in progress Data Types for Recording Data type Description Inputs at bank n 0 or 1 Output bank n status 0 or 1 Analog input status 0 7 Analog output status 0 7 Operand Summary Automatic Data Capture _RC Returns a 0 or where 0 denotes not recording specifies recording in progress Returns address of next array element Deallocating Array Space Array space may be deallocated using the DA command followed by the array name DA 0 deallocates all the arrays 68 Chapter 5 Programming RIO 47xxx Input of Data Numeric and String Input of Data The command IN is used to prompt the user to input numeric or string data Using the IN command the user may specify a message prompt by placing a message in quotations When the RIO executes an IN command it will wait for the input of data The input data is assigned to the specified variable or array element Note The IN command is only valid when communicating through RS232 This command will not work through the Ethernet An Example for Inputting Nu
93. nd see page 70 Programmable I O As described earlier the RIO has 16 digital inputs 16 digital outputs 8 analog inputs and 8 analog outputs The paragraphs below describe the commands that are used for I O manipulation and interrogation Digital Outputs The most common method of changing the state of digital outputs is by using the set bit SB and clear bit CB commands The following table shows an example of the SB and CB commands Instruction Interpretation SB2 Sets bit 2 CBI Clears bit 1 The Output Bit OB instruction is useful for setting or clearing outputs depending on the value of a variable array input or expression Any non zero value results in a set bit Instruction Interpretation OB1 POS Set Output 1 if the variable POS is non zero Clear Output 1 if POS equals 0 OB2 IN 1 Set Output 2 if Input 1 is high If Input 1 is low clear Output 2 OB3 IN 1 amp IN 2 Set Output 3 only if Input 1 and Input 2 are high OB2 COUNT 1 Set Output 2 if element 1 in array COUNT is non zero The output port can be set by specifying the OP Output Port command This instruction allows a single command to define the state of the entire output bank where 20 is bit O 2 is bit 1 and soon A 1 designates that the output is on 72 Chapter 5 Programming RIO 47xxx For example Instruction Interpretation OP6 Sets bits 1 and 2 of bank 0 high All other bits on bank 0 are 0 2 22 6 OPO 0 Clears a
94. nput 6 DO10 Digital Input 7 DO11 Input common DI 8 15 DO12 No connect for standard configuration DO13 Digital Input 8 Digital Input 9 DO14 DOI5 Description Digital Input 10 Digital Input 11 Digital Input 12 Digital Input 13 Digital Input 14 Digital Input 15 12 24V Output Power Supply for DO 0 7 Output Power GROUND for DO 0 7 Digital Output 0 Digital Output 1 Digital Output 2 Digital Output 3 Digital Output 4 Digital Output 5 Digital Output 6 Digital Output 7 12 24V Output Power Supply for DO 8 15 Output Power GROUND for DO 8 15 Digital Output 8 Digital Output 9 Digital Output 10 Digital Output 11 Digital Output 12 Digital Output 13 Digital Output 14 Digital Output 15 PWM outputs See PWM option in Appendix and Chapter 4 When ordered with HS option DI3 is high speed input and DI2 is high speed input DI2 is lost J2 RS 232 Port DB 9 Pin Male Standard connector and cable 9Pin Signal No Connect Ground ko 84 Appendix RIO 47xxx Note A straight thru serial cable should be used to connect the RIO to a standard PC serial port pin to pin1 pin2 to pin 2 etc J1 Ethernet Port 10 100 Base T RJ 45 P N RXP Reserved 7 J5 Power 2 pin Molex Voltage range is 18 36VDC for RIO 471xxx Not used with RIO 47200 This connector is not used when powering the RIO via POE The part number listed below is the connector that is found on the
95. nse can be queried with the _MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response _MW results in 05 _MW results in 85 _MW1 contains 01 or 02 Ways to use Function Code 5 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 5 3 SB 4 CB 5 OB Operating as a slave The RIO will accept a write single coil request with a starting address ranging from 0000 000F referencing digital outputs 0 15 The RIO will respond with a Modbus packet that is identical to the packet it received RIO 47xxx Chapter 3 Communication e 27 Coil Mapping Coil Addresses Coil Addresses 0 Digital Output O 8 Digital Output 8 1 Digital Output 1 9 Digital Output 9 2 Digital Output 2 10 Digital Output 10 3 Digital Output 3 11 Digital Output 11 4 Digital Output 4 12 Digital Output 12 5 Digital Output 5 13 Digital Output 13 6 Digital Output 6 14 Digital Output 14 7 Digital Output 7 15 Digital Output 15 Examples For the following example array contains 0 0 0 0 0 6 1 5 0 7 FF 00 MBA 1 12 array Request to set digital output 7 high MBA 5 7 1 Request to set digital output 7 high SB1007 Request to set digital output 7 high OB1007 IN 1000 Request to set digital output 7 high if digital output 0 is high Packets The command MBA 5 7 1 results i
96. odbus packet that is identical to the packet it received RIO 47xxx Chapter 3 Communication e 29 Coil Mapping Coil Addresses Coil Addresses 0 Digital Output 0 8 Digital Output 8 1 Digital Output 1 9 Digital Output 9 2 Digital Output 2 10 Digital Output 10 3 Digital Output 3 11 Digital Output 11 4 Digital Output 4 12 Digital Output 12 5 Digital Output 5 13 Digital Output 13 6 Digital Output 6 14 Digital Output 14 7 Digital Output 7 15 Digital Output 15 Examples For the following example array contains 0 0 0 0 0 6 1 6 0 0 55 A A MBA 1 12 array MBA 6 0 55AA Request to write digital outputs 15 0 to 55AA Request to write digital outputs 15 0 to 55AA Note writing digital outputs 15 0 to 55AA results in digital outputs 15 0 in descending order being 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 Packets The command MBA 6 0 55AA results in the following packets being sent when one RIO is the master and another RIO is the slave communicating over handle A port 502 Modbus Request Response Field Name hex Field Name hex Function 06 Function 06 Starting Address High 00 Starting Address High 00 Starting Address Low 00 Starting Address Low 00 Register Value High 55 Register Value High 55 Register Value Low AA Register Value Low AA 30 Chapter 3 Communication RIO 47xxx Function Code 7 07
97. ogram execution A program that has been saved into the RIO non volatile memory can be automatically executed upon power up or reset simply by beginning the program with the label AUTO Note The program must be saved into non volatile memory using the command BP Automatic Subroutines for Monitoring Conditions Often it is desirable to monitor certain conditions continuously without tying up the host or RIO program sequences The RIO can monitor several important conditions in the background These conditions include checking for the occurrence of a defined input position error a command error or an Ethernet communication error Automatic monitoring is enabled by inserting a special predefined label in the applications program The pre defined labels are SUBROUTINE DESCRIPTION FAUTO Automatic Program Execution on power up FAUTOERR Automatic Program Execution on power up if error condition occurs ININTn Input specified by II goes low n from 0 to 3 CMDERR Bad command given RIO 47xxx Chapter 5 Programming e 59 TCPERR COMINT Communication Interrupt Routine For example the ININT label could be used to designate an input interrupt subroutine When the specified input occurs the program will be executed automatically NOTE An application program must be running for automatic monitoring to function Example Input Interrupt Instruction HA 110 0 1 LOOP JP LOOP EN ININTO MG INPUT 1 IS HIGH RIO Exa
98. oltage on ModBus devices over Ethernet Instruction Instruction AO 7 1 5 Set the output voltage on output 7 to 1 5V MG AO 2 Display the analog voltage reading on output 2 Real Time Clock The RIO 471x2 firmware revision D and above is equipped with a real time clock feature The real time clock provides true time in seconds minutes and hours The RT command provides a method to set the time and operands to return the current time The default real time clock does not persist through a power cycle and must be set whenever power is restored The RIO 471x2 can be ordered with a clock upgrade RTC including a higher precision clock than the default and a battery backup for the time hardware All hardware is within the standard sheet metal footprint The RTC clock will continue to run when power is removed from the RIO The RTC option also provides a calendar function including year month of year day of month and day of week This feature can be set and queried through the RY command Both versions of the RIO 471x2 real time clock can be set to a TIME protocol RFC 868 server Using IH the RIO can connect to a TIME server over TCP on port 37 and receive the 32bit response The firmware will then set the time and calendar if applicable to the TIME server value The command RO is used to set the GMT time zone offset for localization of the current time The TIME protocol synchronization is designed to connect to a server on the local networ
99. or Code 130 Unrecognized Command This command doesn t MG_ED Print line number where problem occurred 1 00 The error occurred on line 1 of the program Program Flow Commands The RIO provides instructions to control program flow The RIO program sequencer normally executes program instructions sequentially The program flow can be altered with the use of interrupts and conditional jump statements Interrupts To function independently from the host computer the RIO can be programmed to make decisions based on the occurrence of an input interrupt causing the RIO board to wait for multiple inputs to change their logic levels before jumping into a corresponding subroutine Normally in the case of a Galil controller when an interrupt occurs the main thread will be halted However in the RIO the user can indicate in which thread the thread must be already running when the interrupt occurs the interrupt subroutine is to be run When the interrupt occurs the specified thread s main program will be paused to allow the interrupt subroutine to be executed Therefore the user has the choice of interrupting a particular thread execution upon an input interrupt see II command The input interrupt routines are specified using ININTn where n can be 0 3 In this way the RIO can make decisions based on its own I O status without intervention from a host computer The Return from Interrupt RI command is used to return from this subroutine to the
100. or the following reasons 1 The reset line on the controller is held low or is being affected by noise 2 There is a failure on the controller and the processor is resetting itself 3 There is a failure with the output IC that drives the error signal Green Link LED LNK The green LED indicates there is a valid Ethernet connection This LED will show that the physical Ethernet layer the cable is connected Activity ACT The amber LED indicates traffic across the Ethernet connection This LED will show both transmit and receive activity across the connection RIO 47xxx Chapter 1 Overview e 3 Chapter 2 Getting Started RIO 471xx RIO 47100 DIGITAL 30 OPA 29 DO2 28 DOS 320111 31 DI14 ANALOG O 18 AOD 17 AGS 16 AOS 15 GND 14 AT 13 AIS 12 GND TNC Nc GALIL MOTION CONTROL Figure 1 Outline of RIO 471xx Dimensions listed in the Appendix 4 Chapter 2 Getting Started RIO 47xxx RIO 472xx Figure 2 Outline of RIO 472xx Dimensions listed in the Appendix Installing the RIO Board Installation of a complete operational RIO system consists of 4 steps Step 1 Configure jumpers Step 2 Connect power to the RIO Step 3 Install the communications software Step 4 Establish communications between the RIO and the host PC Step 1 Configure Jumpers Power Input Jumpers AUX vs PoE The RIO can be powered using either a 18 36V DC power input or a PoE Power over E
101. racter can be sent by using the format n where n is any integer between 1 and 255 Example MG 407 4255 sends the ASCII characters represented by 7 and 255 to the bus Summary of Message Functions pv Surrounds text string Fn m Formats numeric values in decimal n digits to the right of the decimal point and m digits to the left 70 Chapter 5 Programming RIO 47xxx Zn m Formats values like Fn m except leading zeroes are removed p 8 En Outputs message to Ethernet handle n where n is A B or C p 8 P1 Outputs message to Serial port Sends Email message see MA MD MS commands Displaying Variables and Arrays Variables and arrays may be sent to the screen using the format variable or array x For example V1 returns the value of V1 Removing Leading Zeros from Response The leading zeros on data returned as a response to interrogation commands or variables and arrays can be removed by the use of the command LZ The default value for LZ is 1 meaning that the leading zeroes do not get printed out unless LZO command is entered Example Using the LZ command LZO Disables the LZ function MG IN 0 Print input status of bank 1 0000000001 0000 Response from Interrogation Command With Leading Zeros LZI Enables the LZ function MG IN 0 Print input status of bank 1 1 0000 Response from Interrogation Command Without Leading Zeros Formatting Variables and Array Elements The Variable Format
102. rs DO NOT supply power to high power digital outputs an external supply is required for these outputs 42 Chapter 4 1 0 RIO 47xxx PWM Outputs With firmware revisions Rev D and newer Digital Outputs 14 and 15 can be setup independently as PWM outputs using the DY FQ and PM commands The standard opto isolated outputs found on the RIO 47xxx will have a limited bandwidth 50Hz that will not allow the full range of frequency and duty cycle available from the DY FQ and PM commands The RIO can be ordered with a PWM option that will bypass the opto isolated outputs and provide buffered outputs for DO14 15 See the PWM section in the Appendix for more information Digital Inputs Digital inputs 0 15 are opto isolated inputs with a range of 5 24VDC There is a 2 2k internal series resistor to INCO Input Common Bank 0 for inputs 0 7 and INC1 Input Common Bank 1 for inputs 8 15 The series resistor limits the current through the PS2805 opto coupler The INCO and INCI can either be connected to the positive side of a DC power supply or to the Ground side of a DC power supply When a device is connected to the digital input current flowing through the opto coupler will cause the input to turn on The logic of the input can be configured using the IQ command 5V to 24V or GND 3 3V INCO INC1 Toggle Switch 5V to 24V or GND needs to be the opposite of D1 7 0 what goes into INCO and INC1 DI 15 8 PS2805 Figure 6 Digital Inpu
103. rt number ordering example RIO 47100 IHSRC 2LSRC 0 7 or 8 15 SINK SOURCE These four options are only available on the RIO 472xx By default the RIO 472xx has all 16 high power outputs These options allow either of the two banks of 8 outputs to be configured for low power sinking or low power sourcing For example if output 0 7 need to be configured for low power sourcing and outputs 8 15 need to be configured for high power sourcing the option would be ILSRC 2HRSC The circuits for low power sourcing and sinking will be the same as the circuits for the low power outputs previously defined in Chapter 4 Part number ordering example RIO 47200 1LSNK 2LSRC Outputs 0 7 low power sinking Outputs 8 15 low power sourcing QUAD and SSI All RIO 47122 Encoder Options will utilize Digital Inputs 12 13 14 and 15 and Digital Outputs 12 13 14 and 15 These digital inputs and outputs will not be available as standard digital I O when the QUAD or SSI option is ordered with the RIO 47122 The QE command is used to read the encoder register the WE command sets the current position of the encoder QUAD only and the SE command configures the encoder when the SSI option is ordered The 78 Appendix RIO 47xxx register that is read using the QE command is updated by the RIO every 25ms See the QE WE and SE commands in the RIO command reference for more information Electrical Specifications Power Input buffers Output buffers
104. s The command MBA 7 array results in the following packets being sent when one RIO is the master and another RIO is the slave communicating over handle A port 502 Modbus Assume digital outputs in descending order from 15 0 are 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 55AA Request Response Field Name hex Field Name hex Function 07 Function 07 Output Data AA array 0 on the master RIO will equal 170 in this example 32 Chapter 3 Communication RIO 47xxx Function Code 15 SOF Write Multiple Coils Description Modbus function code 0F is a request to write multiple coils This will write multiple digital outputs to an RIO configured as a slave Operating as a master The function code of the response can be queried with the _MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response _ MW results in 0F _MW results in 8F _MW l contains 01 or 02 Ways to use function code 15 with Galil commands 1 MB command in raw packet mode 2 MB command with Modbus function code 15 Operating as a slave The RIO will accept a write multiple coils request with a starting address ranging from 0000 000F referencing digital outputs 0 15 The RIO will accept a request for up to all 16 of its digital outputs or 0001 0010 The RIO will respond with function code 0F a starting addr
105. s Yes Yes RY providing Year Month of year Day of month Day of week No Yes Settable via TIME protocol server IH and RO commands Yes Yes Clock persists through RIO power loss No Yes No power clock battery life N A More than week Time till failure pending at the time of publication Part number ordering example RIO 47122 RTC RIO 47xxx Appendix e 77 08 15 SOURCE 2LSRC option If a RIO 471xx is ordered with the 08 15 SOURCE option then outputs 8 15 are configured to source current They will be capable of 5 24VDC with 25mA of current in a sourcing configuration 3 3V 3 3V gt gt STA OUTPOWER LED pie 4 oo OP1A a Ne ax Mi DO 15 8 10K LOAD OP1B l OUTRETURN Figure 8 Low Power Sourcing Outputs OPIA should be connected to the positive side of 5 24VDC external power supply OPIB should be connected to Ground on the external power supply OPIA and OPIB are the Output Power for Bank 1 The output can source up to 25mA of current The device should be connected between the digital output DO 15 8 and the return side of the power supply OP1B When current is not flowing though the optocoupler CB the 10k resistor pulls down the output pin to OP1B When current is flowing through the optocoupler SB the digital output switches to the voltage supplied by OP1A and is able to source 25mA of current The bold connections in the schematic above are external connections Pa
106. s the low byte and byte 3 is the high byte Note The header information of the data records is formatted in little endian General Status Information 1 Byte BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0 Program N A N A N A N A Waiting for Trace On Echo On Running input from IN command ZC and ZD Commands Another important feature of the data record is that it contains two variables that can be set by the user The ZC and ZD commands are responsible for these variables Each variable can be a number a mathematical equation or a string See the Command Reference for more information on the ZC and ZD commands 40 Chapter 3 Communication RIO 47xxx Chapter 4 I O Introduction The standard RIO controller has 16 digital inputs 16 digital outputs 8 analog inputs and 8 analog outputs The interrogation command TZ allows the user to get a quick view of the I O configuration and bit status Specifications Access to I O points is made through the 44pin and 26pin High Density D Sub connectors on the top of the unit Pinouts for the Connectors for RIO 47xxx are listed in the Appendix Digital Outputs High Power Digital Outputs On the RIO 471xx digital outputs 0 7 are opto isolated sourcing power outputs On the RIO 472xx all 16 of the digital outputs are configured this way by default 12 24VDC with 500mA of current capability per output The internal circuit
107. sages are also unsolicited because they can come out at any time There are two software commands that will configure how the controller handles these unsolicited messages CW and CF The RIO has 3 Ethernet handles as well as 1 serial port where unsolicited messages may be sent The CF command is used to configure the controller to send these messages to specific ports In addition the Galil RIO 47xxx Chapter 3 Communication e 13 software has various options for sending messages using the CF command For more information see the CF command description in the Command Reference The CW command has two data fields that affect unsolicited messages The first field configures the most significant bit MSB of the message A value of 1 will set the MSB of unsolicited messages while a value of 2 suppresses the MSB Programs like HyperTerminal or Telnet need to use a setting of CW2 for the unsolicited messages to be readable in standard ASCII format However the Galil software needs a value of CW1 to be set so that it can differentiate between solicited and unsolicited messages If you have difficulty receiving characters from the controller or receive garbage characters instead of messages check the status of the CW command The second field of the CW command controls whether the product should pause while waiting for the hardware handshake to enable the transmission of characters over RS 232 CW 0 or continue processing commands and lose c
108. t executed if 1 IF conditional true Message to be executed if 2 IF conditional is true ELSE command for 2 IF conditional statement Message to be executed if 2 IF conditional is false End of 2 conditional statement ELSE ELSE command for 1 IF conditional statement MG ONLY INPUT 2 IS ACTIVE Message to be executed if 1 IF conditional statement ENDIF End of 1 conditional statement W AIT Label to be used for a loop JP W AIT IN 1 0 amp IN 2 0 Loop until both input and input 2 are not active EN End of subroutine Stack Manipulation It is possible to manipulate the subroutine stack by using the ZS command Every time a JS instruction interrupt or automatic routine such as ININTn or CMDERR is executed the subroutine stack is incremented by 1 up to a maximum of 16 Normally the stack is restored with an EN instruction Occasionally it is desirable not to return back to the program line where the subroutine or interrupt was called The ZS1 command clears 1 level of the stack This allows the program sequencer to continue to the next line The ZSO command resets the stack to its initial value For example if an interrupt occurs and the ININT 1 routine is executed it may be desirable to restart the program sequence instead of returning to the location where the interrupt occurred To do this give a ZS ZSO command at the end of the ININT1 routine Auto Start Routine The RIO has a special label for automatic pr
109. ter Write Digital Outputs 7 Read Exception Status Read Digital Outputs 15 Force Multiple Coils Write Digital Outputs 16 Preset Multiple Registers Write Analog Outputs Of the Modbus function codes the RIO supports all are supported by the RIO when it operates as a master also known as a client or when it operates as a slave server Note 1 By default the RIO uses function code 3 for analog inputs and function code 4 for analog outputs For a majority of Modbus devices this functionality is inverted Use the MV command to switch the functionality Please see the command reference for details Note 2 The remainder of this document uses the symbol to signify that numbers are in hexadecimal notation 14 Chapter 3 Communication RIO 47xxx Setup Modbus TCP requires an Ethernet connection between master and slave Modbus TCP also requires that all slaves communicate with their masters over port 502 See the IH command to setup port communication for the RIO Raw Modbus Send Receive Firmware revisions Rev D and newer support raw Modbus read write functionality This provides the user with the most flexibility for interfacing to modbus devices Specifying a 1 for the Modbus function code enables the raw read write of Modbus functions See the MB command in the RIO Command Reference for further details Modbus Read Write to Array Table Firmware revisions Rev D and newer support the ability to read from and write to array
110. the following packets being sent when one RIO is the master and another RIO is the slave and array contains 40A0 0000 4040 0000 communicating over handle A port 502 Modbus MI is set to 0 on the slave Request Response 32 Bit Floating Point Field Name hex Field Name hex Function 10 Function 10 Starting Address Hi 0 Starting Address Hi 0 Starting Address Lo 2 Starting Address Lo 2 Quantity Outputs Hi 0 Quantity of Registers Hi 0 Quantity Outputs Lo 4 Quantity of Registers Lo 4 Byte Count 8 RegVal0 High 40 AO 0 RegVal0 Low 0 RegVall High 40 40 0 RegVall Low 0 The slave RIO will have analog output 1 set to 5V and analog output 2 set to 3V Example 2 The command MBA 16 2 2 array results in the following packets being sent when one RIO is the master and another RIO 47100 is the slave and array contains SFFFF 9999 6666 3333 communicating over handle A port 502 Modbus MI is set to 1 on the slave Request Response Counts Field Name hex Field Name hex Function 10 Function 10 Starting Address Hi 0 Starting Address Hi 0 Starting Address Lo 2 Starting Address Lo 2 Quantity Outputs Hi 0 Quantity of Registers Hi 0 Quantity Outputs Lo 2 Quantity of Registers Lo 2 Byte Count 4 RegVal0 High FF RegVal0 Low FF RegVall High 99 RegVall Low 99 The sla
111. thernet switch to deliver power over the Ethernet cable The default configuration is the 18 36VDC power input If PoE is used the four jumpers on JP6 for the RIO 471xx and JP1 for the RIO 472xx must be moved from AUX to PoE Master Reset and Upgrade Jumper Jumpers labeled as MRST and UPGD are located at JP5 for the RIO 471xx and JP2 for the RIO 472xx next to the reset button The MRST jumper is for a master reset When MRST is jumpered the RIO will perform a master reset upon a power cycle to the board or when the board reset button is pushed Whenever the I O board has a master reset all programs arrays and variables stored in non volatile memory will be erased this will set the RIO board back to factory defaults RIO 47xxx Chapter 2 Getting Started e 5 The UPGD jumper enables the user to unconditionally update the board firmware This jumper is not necessary for firmware updates when the RIO board is operating normally but may be necessary in cases of a corrupted non volatile memory non volatile memory corruption should never occur under normal operating circumstances however corruption is possible if there is a power fault during a firmware update If non volatile memory corruption occurs your board may not operate properly In this case install the UPGD jumper and use the update firmware function in the Galil software to re load the system firmware Setting the Baud Rate on the RIO The default baud rate for the RIO is 115K
112. ts INC jumpers The INC jumpers can be used when an external power supply is not desired for digital inputs 0 15 These inputs can use the internal 5V from the RIO instead To do this place a jumper on the pins labeled INC as shown here When using the INC jumpers the digital inputs must have a reference This reference comes from the RIO from pin 34 INCOB for inputs 0 7 and from pin 16 INC1B for inputs 8 15 RIO 47xxx Chapter 4 I O e 43 Toggle Switch DIO DI7 or DI8 DI15 INCOB pin 34 or INC1B pin 16 Pulse Counter Input Digital input 3 DI3 is a special purpose input that when enabled is used to count pulses coming in To enable the pulse counter the PC command must be issued with the following syntax 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 When the PC command is enabled input DI3 will count high or low going edges The operand _PC is used to report back the number of pulses counted The maximum frequency of the input is limited by the opto couplers to 300 Hz If a higher frequency is needed order the HS option in the Appendix Expanded Memory RIO When using the expanded memory RIO RIO 47102 RIO 47122 RIO 47202 the Input 3 cannot be use
113. tter after that numbers are permitted Spaces are not allowed The maximum number of labels that can be defined in the RIO 47xx0 is 62 The RIO 47xx2 increases this to a total of 126 labels Valid labels BASICIO SQUARE X1 input1 Invalid labels 1Square 123 PROGRAMMING longer than 7 characters Special Labels The RIO also has some special labels which are used to define input interrupt subroutines and command error subroutines The following is a list of the automatic subroutines supported by the RIO Sample programs for these subroutines can be found in the section Automatic Subroutines for Monitoring Conditions AUTO Automatic Program Execution on power up ININTn Label for Input Interrupt subroutine CMDERR Label for incorrect command subroutine TCPERR Ethernet communication error AUTO is a special label for automatic program execution A program which has been saved into the controller non volatile memory using the BP Bum Program command can be automatically executed upon power up or reset by beginning the program with the label AUTO Commenting Programs Using an Apostrophe to Comment The RIO provides an apostrophe for commenting programs This character allows the user to include up to 39 characters on a single line after the apostrophe and can be used to include comments from the programmer as in the following example HOUTPUT PROGRAM LABEL SB1 CB2 Set Bit 1 and Clear Bit 2 EN END
114. turn analog input at general input n where n starts at 0 AO n Return analog output at general output n where n starts at 0 These functions are multi valued An application program may be used to find the correct band n INTIn n n n Functions may be combined with mathematical expressions The order of execution of mathematical expressions is from left to right and can be over ridden by using parentheses Examples V1 ABS V7 The variable V1 is equal to the absolute value of variable V7 V2 5 SIN POS The variable V2 is equal to five times the sine of the variable POS V3 IN 1 The variable V3 is equal to the digital value of input 1 Variables For applications that require a parameter that is variable the RIO 47xx0 board provides 126 variables The RIO 47xx2 increases this to 254 total available variables These variables can be numbers or strings A program can be written in which certain parameters such as I O status or particular I O bit are defined as variables The variables can later be assigned by the operator or determined by program calculations Example SB Red Uses variable Red in SB command inputl GIN 1 Assigns value of digital input 1 status to variable input1 Programmable Variables The RIO allows the user to create up to 126 variables Each variable is defined by a name which can be up to eight characters The name must start with an alphabetic character how
115. unt 02 Starting Address Low 02 Outputs Status 9 2 CD Quantity of Outputs High 00 Outputs Status 13 10 0C Quantity of Outputs Low 0C 1 Byte of Response Word bit 7 6 5 4 3 2 1 0 Coil 9 8 7 6 5 4 3 2 Value 1 1 0 0 1 1 0 1 2 Byte of Response Word bit 15 14 13 12 11 10 9 8 Coil X X X X 13 12 11 10 Value 0 0 0 0 1 1 0 0 Note bits in the response marked X are not valid coil response data but are instead 0 s that fill the remainder of the byte On the master RIO array 0 205 and array 1 12 after the MBA 2 2 12 array command is issued 18 Chapter 3 Communication RIO 47xxx Function Code 2 02 Read Discrete Inputs Description Modbus function code 02 is a request to read discrete inputs This will read digital inputs from an RIO configured as a slave Operating as a master The function code of the response can be queried with the MW command If an exception occurred the exception code of the response can be queried with MWI Example Normal Response Exception Response MW results in 02 _MW results in 82 _MW l contains 01 or 02 When using the MB command with Modbus function code 02 response data will be stored in the array referenced in the command line When using IN EIN contains the response data which can either be stored to a variable or transmitted vi
116. ure response The PID values entered were experimentally found to provide optimum results based on the system The desired set point was chosen as 1V A dead band of 0 1V was added in order to prevent the system from responding to minor disturbances of the sensor PCL 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 Note When the Process Control Loop is enabled the Analog output voltage is normalized to half of the total voltage input For instance with a 0 5V analog input range such as the RIO 47100 the voltage is normalized to 2 5V This allows the output to go below 2 5 to compensate for a negative error and above 2 5V to compensate for positive error The AQ and DQ must be set on the RIO 47120 to configure the Analog input and output ranges before the process control loops are run and prior to setting AZ amp AF The range of the PS command is dependant on the AQ command Current vs Flow Control Mode The PID loop on the RIO 47xxx by default works as a current mode loop This means that when position error is O the analog output will also be set to zero Firmware revisions Rev D and newer allow the user to set a negative value for the DB command that will set the Process control loop into a flow control or velocity mode When D
117. utputs being returned byte count quantity of outputs 8 if the remainder is not 0 byte count quantity of outputs 8 1 The RIO will respond with a coil status of 1 or 2 bytes equal to the byte count ranging from 0001 FFFF with each bit representing the state of a digital output 1 or 0 The LSB of the first coil status byte refers to the output addressed by the request packet Coil Mapping Coil Addresses Coil Addresses 0 Digital Output 0 8 Digital Output 8 1 Digital Output 1 9 Digital Output 9 2 Digital Output 2 10 Digital Output 10 3 Digital Output 3 11 Digital Output 11 4 Digital Output 4 12 Digital Output 12 5 Digital Output 5 13 Digital Output 13 6 Digital Output 6 14 Digital Output 14 7 Digital Output 7 15 Digital Output 15 RIO 47xxx Chapter 3 Communication e 17 Examples MBA 1 2 12 array Request the status of coils 2 13 result is stored in array MGOUT 1002 Requests the status of coil 2 result is transmitted via serial port or ethernet Packets The command MBA 1 2 10 array results in the following packets being sent when one RIO is the master and another RIO is the slave communicating over handle A port 502 Modbus Assume digital outputs in descending order from 15 0 are 0 1 1 1 0 0 1 1 0 0 1 1 0 1 1 1 Request Response Field Name hex Field Name hex Function 01 Function 01 Starting Address High 00 Byte Co
118. ve RIO will have analog output 2 set to 5V and analog output 3 set to 3V RIO 47xxx Chapter 3 Communication e 37 Analog IO Ranges The analog inputs and outputs range from different values depending on the configuration of the RIO 471x0 This information is specifically important when using the RIO to communicate as a modbus slave and MI is set to 1 RIO 47100 Analog Inputs AQx m see command reference for details m Analog Range Counts Range decimal Counts Range hex 0 0 5V 0 32572 0x0000 Ox7FFO 1 5V 0 32572 0x0000 0x7FFO Analog Outputs Analog Range Counts Range decimal Counts Range hex 0 5V 0 65520 0x0000 OxFFFO RIO 47120 12 or 16 bit version Analog Inputs AQx m see command reference for details m Analog Range Counts Range decimal Counts Range hex 1 5V 32768 to 32767 0x8000 Ox7FFF 2 10V 32768 to 32767 0x8000 Ox7FFF 3 0 5V 0 65535 0x0000 OXFFFF 4 0 10V 0 65535 0x0000 OXFFFF Analog Outputs DQx m see command reference for details m Analog Range Counts Range decimal Counts Range hex 1 0 5V 0 65535 0x0000 OXFFFF 2 0 10V 0 65535 0x0000 OXFFFF 3 5V 0 65535 0x0000 OXFFFF 4 10V 0 65535 0x0000 OXFFFF 38 Chapter 3 Communication RIO 47xxx Data Record QR and DR Co
119. what is specified by the CF command add an Eh or P1 to the end of the command Ex MG EB Hello will send the message Hello to handle 2 and MG P1 Hello will send it to the serial port Handling Communication Errors A reserved automatic subroutine which is identified by the label TCPERR can be used to catch communication errors If an RIO has an application program running and the TCP communication is lost the TCPERR routine will automatically execute The TCPERR routine should be ended with the RE command Multicasting A multicast may only be used in UDP IP and is similar to a broadcast where everyone on the network gets the information but specific to a group In other words all devices within a specified group will receive the information that is sent in a multicast There can be many multicast groups on a network and are differentiated by their multicast IP address To communicate with all the devices in a specific multicast group the information can be sent to the multicast IP address rather than to each individual device IP address All Galil devices belong to a default multicast address of 239 255 19 56 This multicast IP address can be changed by using the A gt u command Unsolicited Message Handling Unsolicited messages are any messages that are sent from the controller that are not directly requested by the host PC An example of this is a MG or TP command inside of a program running on the controller Error mes
120. where the subroutine was called JP BLUE ABS V2 gt 2 Jump to BLUE if the absolute value of variable V2 is greater than 2 JP C V1 V7 lt V8 V2 Jump to C if the value of V1 times V7 is less than or equal to the value of V8 V2 JP A Jump to A Using If Else and Endif Commands The RIO provides a structured approach to conditional statements using IF ELSE and ENDIF commands Using the IF and ENDIF Commands An IF conditional statement is formed by the combination of an IF and ENDIF command The IF command has arguments of one or more conditional statements 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 RIO will ignore commands until the associated ENDIF command is executed OR an ELSE command occurs in the program see discussion of ELSE command below Note An ENDIF command must always be executed for every IF command that has been executed Using the ELSE Command The ELSE command is an optional part of an IF conditional statement and allows for the execution of commands only when the argument of the IF command evaluates False The ELSE command must occur after an IF command and has no arguments If the argument of the IF command evaluates false the RIO will skip commands until the ELSE command If the argument for the IF command evaluates true the RIO board will execute the commands between the I
121. words and arithmetic expressions The bit wise operators may also be used with strings This is useful for separating characters from an input string When using the input command for string input the input variable will hold up to 6 characters These characters are combined into a single value which is represented as 32 bits of integer and 16 bits of fraction Each ASCII character is represented as one byte 8 bits therefore the input variable can hold up to six characters The first character of the string will be placed in the top byte of the variable and the last character will be placed in the lowest significant byte of the fraction The characters can be individually separated by using bit wise operations as illustrated in the following example Instruction Interpretation FTEST Begin main program IN ENTER LEN S6 Input character string of up to 6 characters into variable LEN FLEN FRAC LEN Define variable FLEN as fractional part of variable LEN FLEN 10000 FLEN Shift FLEN by 32 bits IE convert fraction FLEN to integer LEN1 FLEN 00FE Mask top byte of FLEN and set this value to variable LEN LEN2 FLEN amp FF00 100 Let variable LEN top byte of FLEN LEN3 LEN amp 000000FF Let variable LEN3 bottom byte of LEN LEN4 LEN amp 0000FFO00 100 Let variable LEN4 second byte of LEN LEN5S LEN amp 00FF0000 1000 Let variable LENS third byte of LEN 0 LEN6 L
122. xx to be placed on the side labeled PoE Once this is done the controller will derive its power directly from the Ethernet cable A PoE style switch can be used such as the FS108P from Netgear Applying power will turn on the green LED power indicator 6 Chapter 2 Getting Started RIO 47xxx Step 3 Install the Communications Software After applying power to the computer install the Galil software that enables communication between the I O board and your PC Itis strongly recommended to use the Galil software GalilTools when communicating to the RIO unit Please see the GalilTools Manual for a complete description of how to install and connect to Serial or Ethernet controllers http www galilmc com products software galiltools html Step 4 Establish Communications between RIO and the Host PC Communicating to the RIO using Galil Software RS 232 To use serial communication connect a 9pin straight through RS 232 cable CABLE 9 PIND between the serial port of the RIO and the computer or terminal communications port The RIO serial port is configured as DATASET Ethernet Connect the RIO Ethernet port to your computer via a crossover Ethernet cable or to a network hub with a straight through Ethernet cable Using Non Galil Communication Software RS 232 The RIO serial port is configured as DATASET The computer or terminal must be configured as a for full duplex no parity 8 data bits one start bit and one stop bit
Download Pdf Manuals
Related Search
Related Contents
AUDIOPHILE Configuration Software User`s Manual Samsung P2450H manual de utilizador Manual - Alge EzCapture お客さまのために Signaling System 7 MPC860 SS7 Protocol Microcode User`s Manual Untitled - Valcourt DVRPC16T/NVRP4 CMPC Manual John Deere ET-3302-J User's Manual カウンター下マルチ収納ポケット レギュラー Copyright © All rights reserved.
Failed to retrieve file