Home
RIO-47100 User Manual manRIO47100
Contents
1. RIO Chapter 4 e 31 LOOP TEMP IN 1 I IN 2 JSHCOND TEMP 1 JP LOOP EN COND IF IN 1 0 IF IN 2 0 MG INPUT 1 AND INPUT 2 ARE INACTIVE ELSE MG ONLY INPUT 1 IS ACTIVE ENDIF ELSE MG ONLY INPUT 2 IS ACTIVE ENDIF Begin loop inside main program 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 218 IF conditional statement executed if 17 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 command for 1 IF conditional statement Message to be executed if 17 IF conditional statement 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 interru
2. 8 720 pri 7010 SS 360020 6013 gg 35 015 5016 oo 20 DI7 a 8l2e 34 NIC 4NC 5 alge 4 20 58 29 ont 18010 SOOO 17 DI13 n 3 25 31014 cuc 1015 lt a lt o S 6 le es s SERIAL ANALOG 18400 2 GND 26 AO1 8 A02 28128 17 ABIDA 254 7 AOS 18 36VDC 24 107 16 06 O7 GND 5 SA z 22 4AM 5 SAI 20 Nc 2NIC TONIC tang NIC GALIL MOTION CONTROL ETHERNET PoE MADE IN USA Figure 2 1 Outline of RIO RIO Chapter 2 Getting Started e 3 Installing the RIO Board Installation of a complete operational RIO system consists of 5 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 5 Configure the RIO for Galil s Distributed Control System 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 Ethernet 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 located next to Ethernet connector must be moved from AUX to PoE Master Reset and Upgrade Jumper Jumpers labeled as MRST and UPGD are located at J5 next to the reset button The MRST jumper
3. 26 Chapter 4 0 RIO 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 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 opera
4. Appendix e 53 List of Other Publications 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 Training Seminars Galil a leader in motion control with over 500 000 controllers working worldwide 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 0
5. USER MANUAL RIO 47100 Manual Rev beta1 By Galil Motion Control Inc Galil Motion Control Inc 3750 Atherton Road Rocklin California 95765 Phone 916 626 0101 Fax 916 626 0102 Email support galilmc com URL www galilmc com Rev Date 8 20 07 Contents CHAPTER T OVERVIEW 1 INTRODUCTION atc kalm nue 1 RIO FUNCTIONAL ELEMENTS nee E E SEES 1 Microc mp ter Section 1 Communication narrio aaa ette a 1 CHAPTER 2 GETTING STARTED 3 THE RIO CONTROLLER nt tse co erede torva ehh rot eus en nat 3 INSTALLING THE RIO iu aee dea Sain Sa 4 Step Conteurs J ME Smesne oc eas dst aaa 4 Step 2 Connecting Power to the terit e nocens e de kattad 4 Step 3 Install the Communications Software 5 Step 4 Establish Communications between RIO and the Host PC 5 Communicating to the RIO using Galil Software 5 Using Non Galil Communication Software ss 6 CHAPTER 3 COMMUNICATION viccssscscccscentssesssotssecssssecosvanssessconssenbesnessonsosbessbecnsaessns 8 INTRODUCTION cose Te oe iei sao tal naan died cad sae Men laatade 8 BES 232 PORT ey eise ees cd guises Re 8 Port T ee galale sma 8 RS 232 Configuration civic te AREE ORNA AORTA nantais 8 ETHERNET CONFIGURATION ne uinci t nl
6. 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 15 BIT 14 BIT 13 BIT 12 BIT 11 BIT 10 BIT9 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 is 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 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 RIO Chapter 3 Communication e 15 16 Chapter 3 Communication RIO 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 Specific
7. 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 If a higher frequency is needed please contact Galil 22 Chapter 4 0 RIO Chapter 5 Application 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 program memory size is 200 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 a
8. 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 30 e Chapter 4 0 RIO Instruction Interpretation JP Loop COUNT lt 10 Jump to Loop if the variable COUNT is less than 10 JS MOVEZ2 IN 1 1 Jump to subroutine MOVE2 if input 1 is logic level high After the subroutine MOVE2 is executed the program sequencer returns to the main program location 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 1f 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 e
9. 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 used with the XQ command in the following format RIO Chapter 4 I O e 33 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 JP A EN B N 17 SB N TY EN CMDERR IF TC 6 N 1 XQ ED2 ED1 1 ENDIF IF TC 1 XQ ED3 ED1 1 ENDIF EN Interpretation Begin thread 0 continuous loop End of thread 0 Begin thread 1 Create new variable Set the 17th bit an invalid value Issue invalid command End of thread 1 Begin command error subroutine If error is out of range SB 8 Set N to a valid number Retry SB N command If error is invalid command TY Skip invalid command End of command error routine Example Ethernet Communication Error Thi
10. Power 0 e pul 49 PERFORMANCE SPECIFICATIONS un sn ied ie ee 49 CONNECTORS ON THE RIO 5 en eed eee aata arad 50 44 pin D Sub Connecti ans idee ae 50 26 0 ii 50 DB PIME aiamaa REMO ser NN 51 J1 Ethernet Port 10 100 Base T RJ 45 51 15 Power 2 pin Molex for 18 36 VDC if not using Power over Ethernet 51 JUMPER DESCRIPTION FOR a a de aee noi rr ed 52 RIO DIMENSIONS NM 8 53 ACCESSORIES AND OPTIONS bee euo caos e 53 EIST OF OTHER PUBLICATIONS iiie ne E ne mt et 54 TRAINING SEMINARS 220 telae etel ha ed alia dde a 54 CONTACTING 0002000 aa 55 WARRANTY EET 56 Chapter 1 Overview Introduction Derived from the same fundamentals used in building the Galil motion controllers the RIO 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 hardware or Ethernet handle
11. 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 1 lt 2 Internal Variable TI12255 _DM lt 100 I O V1 GIN 2 IN 1 0 Multiple Conditional Statements The RIO will accept multiple conditions in a single jump statement The conditional statements are combined in pairs using the operands amp and I The amp operand between any two conditions requires that both statements be true for the combined statement to be true The operand between any two conditions requires that only one statement be true for the combined statement to be true Note Each condition must be placed in 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 V2 amp V3 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
12. 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 44 Chapter 4 0 FIO V1 10 Assign V1 Vl Return V1 0000000010 0000 Default Format Vl F4 2 Specify local format 0010 00 New format V1 42 Specify hex format 000A 00 Hex value V1 ALPHA Assign string ALPHA to V1 V1 S4 Specify string format first 4 characters ALPH The local format is also used with the MG command see page 43 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 CB1 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
13. 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 29 is bit 0 2 is bit 1 and soon A 1 designates that the output is on 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 OP0 0 Clears all bits of bank 0 and 1 OPO 7 Sets output bits 0 1 and 2 to one 20 422 on bank 1 Clears all bits on bank 0 RIO Chapter 4 I O e 45 The state of the digital outputs can be accessed with the 9 OUT n where n is the output number Ex MG OUTT 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 OIN 1 0 Jump to A if input 1 is low MGOIN 2 Display the state of input 2 AI 7 amp 6 Wait until input 7 is high and input 6 is low Input In
14. idon aa nad avama hn pask A aga 23 23 Using Labels m naines 23 ABRIS uoo re trono bou abii Sisters 24 Comtenmting PrOSrdimJs dota 24 Program Lines Greater than 40 Characters eese 25 Lock Program Access using Password 25 25 EXECUTING PROGRAMS MULTITASKING DEBUGGING PROGRAMS nid sr Duque ud ds uiu ci ete 26 WAC ONG Pr DEM 26 Error Code Commandant n era ru eta qa te Eee PNE USATE MUS eR e ite ku kude Te 27 27 RAM Memory Interrogation 27 0 Deb gging Example nt 4 ku indienne 21 PROGRAM FLOW COMMANDS taandumas 28 28 E PORE ta E tte ONES Lr desde 28 Conditional rr oes ote eo mtv teuer da eei teri wane oon mies edet ded 29 31 Using If Else Stack ee 32 PAULO STALL tag ul ue p ane 32 Automatic Subroutines for Monitoring Conditions 32 MATHEMATICAL AND FUNCTIONAL EXPRESSIONS 35 a kdo QD E ee la 35 Mathematical Bit Wise Operators ano pA ande kaduv kude xe an 35 He Rare nor alatu s I E NE 36 VARIABLES E 37 Bro ramimable 5 eere eee tnde eai teste uie 37 OPERANDS 38 Exampl
15. is established a standard Windows Telnet session can connect to the controller Sending Test Commands to the Terminal after a successful Connection After connecting to the computer or terminal press carriage return or the enter key on the keyboard In response to carriage return CR the controller responds with a colon Now type TZ CR This command directs the RIO to return the current I O status The controller should respond with something similar to the following DIE Block 0 7 0 Inputs value 255 1111 1111 Block 1 15 8 Inputs value 255 1111 1111 Block 0 7 0 Outputs value 0 0000 0000 Block 1 15 8 Outputs value 0 0000 0000 Analog Inputs 7 0 0 0000 0 0000 0 0000 0 0000 0 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 6 Chapter 2 Getting Started RIO 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 Here s an example screenshot of the web server RIO 1 0 Controller Mozilla Firefox File Edit View History Bookmarks Split Tools Help lt a fit C http 192 168 15 4 RIO CONTROLLER DIGITAL INPUT STATES 15 14 13 12 11 5 4 S
16. n from 0 to 3 32 e Chapter 4 0 RIO CMDERR Bad command given 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 FA 110 0 1 LOOP JP LOOP EN ININTO MG INPUT 1 IS HIGH RIO Example 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 200 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
17. using Galil software as the Galil Ethernet driver will take care of the low level communication requirements 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 Addressing There are three levels of addresses 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 addre
18. 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 Galil 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 Gexample 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 ser
19. 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 in a 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 PLE est 1 1 Locks 0 unlocks LS 2 TCl 106 Privilege violation 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 RIO Chapter 4 I O e 25 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 HININTn 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 Where A represents the label and n indicates the thread number To halt the execution of any thread use the instruction where is the thread number Note that both the XQ and H
20. 0 Analog Output 0 Analog Outputs 0 5V range Analog Outputs 0 7 have a voltage range of 0 5VDC They have 12bit DAC a resolution of approximately 1 22mV The analog outputs can sink or source up to 5mA of current 5V OUT AO 0 7 LTC2620 20 e Chapter 4 0 RIO The AQ command allows the RIO to change the configuration from the default 8 single ended analog inputs to 4 differential 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 5VDC and ANI is at OVDC a value of 1 5V is reported on AN 0 and 9 AN I AQ Differential Pairs AQ 0 1 Input 0 8 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 Here s the equation used to get the analog value for a sample pair of inputs 0 and 1 AI value InputO Analog Process Control Loop A Process Control Loop allows closed loop control of a process or device The RIO has two independent PID filters to provide process control of two devices simultaneously The set o
21. 0 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 54 Appendix RIO tuning and motion programming This is a hands on seminar and students can test their application on actual hardware and review it with Galil specialists TIME Two days 8 30 am 5 00 pm Contacting Us Galil Motion Control 3750 Atherton Road Rocklin CA 95765 Phone 916 626 0101 Fax 916 626 0102 E Mail Address support galilmc com URL www galilmc com FTP www galilmc com ftp RIO Appendix e 55 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 Mo
22. Ethernet port 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 RIO Chapter 1 Overview e 1 PWR LJ LNK ERR OJ 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 for the following reasons 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 2 e Chapter 1 Overview RIO Chapter 2 Getting Started The RIO Controller DIGITAL 15 OPOA 44 DOO p 14001 43003 Sapos 13004 42 006 57opog 12007 MNC Dog 11 40 009 pots 100010 390012 90013 38 0015
23. The example program below uses analog input 0 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 temperature 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 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 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
24. X commands can be performed from within an executing program For example Instruction Interpretation Task1 label ATO Initialize reference time Clear Output 1 LOOPI Loop label AT 10 Wait 10 msec from reference time SBI Set Output 1 AT 40 Wait 40 msec from reference time then initialize reference CB1 Clear Output 1 JP LOOP1 Repeat 1 TASK2 Task2 label XQ TASK1 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 XO 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 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 TRO 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
25. actional part of variable LEN FLEN 10000 FLEN Shift FLEN by 32 bits IE convert fraction FLEN to integer LEN1 FLEN amp 00FF 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 LENS5 LEN amp 00FF0000 1000 Let variable LENS third byte of LEN 0 LEN6 LEN amp FF000000 1000 Let variable LEN6 fourth byte of LEN 000 MG LEN6 S4 Display LENO 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 LEN4 as string message of up to 4 chars MG LEN3 S4 Display LEN as string message of up to 4 chars MG LEN 54 Display LEN as string message of up to 4 chars MG LEN 54 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 42 To illustrate further if the user types in the string TESTME at the input prompt the RIO will respond with the following T Response from command MG LEN6 S4 E R
26. age reading on input 2 AA 1 4 5 Wait until the voltage on input 1 reaches 4 5 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 The standard voltage range is 0 to 5 VDC 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 12 bit module 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 voltage 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 RIO Chapter 4 I O e 47 THIS PAGE LEFT BLANK INTENTIONALLY 48 e Chapter 4 0 RIO A
27. ata 42 Internal Variable 31 39 Interrogation 43 Interrupt 25 30 J Jumpers 8 K Keyword 31 36 39 L Label Special Label 25 Logical Operator 30 Masking Bit Wise 36 Math Function Absolute Value 32 38 2 e Appendix Bit Wise 36 Cosine 40 Logical Operator 30 Sine 38 Mathematical Expression 36 38 Memory 24 28 30 40 41 Array 1 24 28 31 36 46 50 Download 24 41 Message 28 37 Moving Circular 41 Multitasking 26 O Operand Internal Variable 31 39 Operators Bit Wise 36 Output of Data 43 p Program Flow 24 29 Interrupt 30 Stack 47 Programmable 46 S Selecting Address 56 Serial Port 5 6 Sine 38 Special Label 25 Stack 47 Zero Stack 47 Status 39 Interrogation 43 Stop Code 39 Subroutine 25 Automatic Subroutine 33 T Terminal 39 44 Time Clock 40 Time Interval 41 Trigger 24 V Variable Internal 31 39 Vector Mode Circular Interpolation 41 Z Zero Stack 47 2 e Appendix
28. ations Access to I O points is made through the 44pin and 26pin High Density D Sub connectors on the top of the unit Pin outs and I O specifications are listed below 44 pin D Sub Connector Digital I O Description Description Description Digital Input 15 No Connect 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 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 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 Chapter 4 I O e 17 High Power Sourcing Outputs 0 7 Digital Outputs 0 7 are opto isolated sourcing power outputs 12 24VDC with 500mA of current capability per output The internal circuit diagram
29. 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 with integrated Ethernet and an I 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 Packaging of the RIO product includes a boxed enclosure and a DIN rail mountable option The RIO can be powered with either a 18 36V DC input or directly through the Ethernet cable using a PoE Power over Ethernet switch 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 125 microseconds The Non volatile memory includes 200 lines x 40 characters of program space 126 symbolic variables 62 labels and 400 total array elements in up to 6 arrays Communication The communication interface with the RIO consists of one RS 232 port default is 115 kBaud s and one auto negotiating 10 100Base T
30. d 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 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 V1 Return V1 0000000010 0000 Default format VF2 2 Change format V1 Return V1 10 00 New format VF 2 2 Specify hex format V1 Return V1 0A 00 Hex value Change format V1 Return V1 9 Overflow 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
31. ed Spaces are not allowed The maximum number of labels that can be defined is 62 Valid labels BASICIO SQUARE RIO Chapter 4 I O e 23 X1 inputl 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 Burn 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 OUTPUT PROGRAM LABEL SB1 CB2 Set Bit 1 and Clear Bit 2 EN END OF PROGRAM Note The NO command also works to comment programs The inclusion o
32. erial Number 3 uuu Us Firmware Rev 1 0 DIGITAL OUTPUT STATES 15 14 15 12 n 10 GALIL 9 8 7 6 5 43 2 __ ___ _ THREAD STATUS 2969844 Command 584 execute RIO Chapter 2 Getting Started e 7 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 an auto negotiating 10 100Base T link RS232 Port The RIO board has a single RS232 connection for sending and receiving commands from a PC or other terminal The pin outs for the RS232 connection are as follows RS232 Port 1 1 N C No Connect 6 N C 2 TXD Transmit Data 7 RTS Ready to Send 3 RXD Receive Data 8 CTS Clear to Send 4 N C 9 N C Can connect 5V if needed 5 Ground 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 1 15k baud but can be set to 19 2k baud by placing a jumper on J5 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 i
33. es 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 Command Summary Automatic Data Capture RA n m Lo 1 p Selects up to four arrays for data capture The arrays must be defined with the DM command 40 e Chapter 4 0 RIO 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 m is optional 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 m is 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 RC Returns a 0 or 1 where 0 denotes not recording 1 specifies recording in progress Data Types for Recording Data type m ar Output bank n status or D Analog input satus 0 7 Analog output status 07 Operand Summary Automatic Data Capture _RC Returns a 0 or where 0 denotes not recording spec
34. es of Internal Variables fase 38 Special Operands Keywords liiska areaali osque ROPA Usa 38 39 0 Defining e ka 39 Assignment of Array Entries as testes l hik aer eo eee Re sonett it Bei occid 39 Using a Variable to Address Array Elements 40 Uploading and Downloading Arrays to On Board 40 Automatic Data Capture into Arrays iius edens Hee Ra need oen SUL IHE Ra Ene kka liin ad 40 Deallocating Array Space E t 41 INPUT OF DATA NUMERIC AND STRING ccccessessececesececeesessnsecececeeeceesensaeeeseeseseneneas 41 PRE OL DATE Se Ne D 41 OUTPUT OF DATA NUMERIC AND STRING 42 IVES SSUES aaa Rus toons eMe oe us ec cdd 42 Displaying Variables and Arrays deese o erede Vo eade trud tn en 43 Formatting Variables and Array Elements 44 PROGRAMMABLE o net ee nd nr ten Pat opt damus at 45 Disita ml a karaat laial 45 piri d 46 Input Intetrupt PUM UCI sigs seek cade oos o A lp eo Noe 46 Analog ree a r seas gen D UG SACS RERBA RE 46 AHAS tete Mu cu e 47 APPENDIK qe c 49 ELECTRICAL SPECIFICATIONS to deinen ducatos ste dba NN edicta 49 Mm 49
35. esponse from command MG LENS S4 S Response from command MG LEN4 S4 T Response from command MG LEN3 S4 M Response from command MG LEN 54 E Response from command MG LENI S4 Functions SIN n Sine of n n in degrees with range of 32768 to 32767 and 16 bit fractional resolution COS n Cosine of n n in degrees with range of 32768 to 32767 and 16 bit fractional resolution TAN n Tangent of n n in degrees with range of 32768 to 32767 and 16 bit fractional resolution ASIN n Arc Sine of n between 90 and 90 Angle resolution in 1 64000 degrees ACOS n Arc Cosine of n between 0 and 180 Angle resolution in 1 64000 degrees ATAN n Arc Tangent of n between 90 and 90 Angle resolution in 1 64000 degrees 36 e Chapter 4 0 RIO IN n Return digital input at general input n where n starts at 0 OUTIn Return digital output at general output n where n starts at 0 AN n Return 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 Note These functions are multi valued An application program may be used to find the correct band 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 OSIN POS The
36. f 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 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 RIO Chapter 4 e 21 5 16 70 Temperature Setpoint PS E PID Digital DAC Heater System T Ks Temperature Feedback Sensor Volts
37. f 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 on 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 24 e Chapter 4 0 RIO 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 var101250 MG Condr 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 Lock Program Access using 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
38. following The Final Value 0 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 is FNAME S3 N gt 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 character can be sent by using the format n where 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 Surrounds text sg O Fn m Formats numeric values in decimal n digits to the right of the decimal n 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 RIO Chapter 4 I O e 43 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 comman
39. 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 array name NOTE Arrays must be defined using the command DM before assigning entry values Examples DM OUTPUT 10 Dimension Output Array OUTPUTI 1 3 Assigns the second element of the array OUTPUT the value of 3 OUTPUTI I J Returns array element value OUTPUT 9 TIO Assigns the 10th element of the array OUTPUT the value for bank 0 digital inputs data 2 COS POS 2 Assigns the third element of the array data the cosine of the variable POS multiplied by 2 RIO Chapter 4 I O e 39 TIMER 1 TIME Assigns the second element of the array timer the returned value of the TIME keyword Using a Variable to Address Ar
40. ifies 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 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 RIO Chapter 4 I O e 41 An Example for Inputting Numeric Data A 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 outp
41. iguration The four jumpers on JP6 will be located on the side labeled AUX Apply a DC power supply in the range of 18 36V to the 2 pin 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 numbers list the mating connectors that are required for connecting to the unit not the connectors that are actually on the unit VDC 18 36V DC GROUND Molex Part Number Crimp Part Number Type 39 01 2025 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 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 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 It is 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 Ste
42. ings 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 s12 9 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 V1 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 Variables may be sent to the screen using the format variable For example 1 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 INIZGIN 1 Assigns value of input 1 to the variable INI 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 er
43. input 10 high AI 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 ININT1 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 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 28 e Chapter 4 0 RIO 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 GIN 3 1 Instruction Interpretation INPUT Program Label AI 1 amp 3 Wait for input 1 low and input 3 high TZ List the e
44. ion code of 1 The format of the command is 1 len array where lenis the number of bytes and array is the array with the data The second level incorporates the Modbus structure This is necessary for sending configuration and special commands to another device The formats vary depending on the function code that is called For more information refer to the MB command in the Command Reference section The third level of Modbus communication uses standard Galil commands Once the slave has been configured the commands that may be used are IN AN SB CB OB and AO For example AO 2020 8 2 would tell I O number 2020 to output 8 2 Volts If a specific slave address is not necessary the I O number to be used can be calculated with the following I O Number HandleNum 1000 Module 1 4 BitNum 1 where HandleNum is the handle number from 1 A to 3 C Module is the position of the module in the rack from 1 to 16 BitNum is the I O point in the module from 1 to 8 RIO as Modbus Slave Unlike Galil Ethernet controllers the RIO can be a ModBus slave as well as a master Being a slave means that another RIO or Galil Controller can send and receive information from an RIO using all three levels of Modbus communication described above The port used to communicate to an RIO as a ModBus slave is 502 use the IH command to set the port number and the RIO supports function codes 1 7 and 16 as a slave See the table abo
45. 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 EEPROM will be erased this will set the RIO board back to factory defaults 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 EEPROM EEPROM corruption should never occur under normal operating circumstances however corruption is possible if there is a power fault during a firmware update If EEPROM 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 Gumper OFF The jumper labeled 19 2 also located at JP5 allows the user to select the serial communication baud rate The baud rate can be set using the following table 19 2 BAUD RATE OFF 115k 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 4 e Chapter 2 Getting Started RIO 1 AUX 18 36VDC power input is the default conf
46. is shown here OPOA DO 7 0 ZX MMBD1204 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 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 18 Chapter 4 1 0 RIO Low Power Sinking Outputs 8 15 Digital Outputs 8 15 are opto isolated sinking outputs 5 24VDC with 25mA of current capability in a sinking configuration 3 3V 3 3V OP1B DO 15 8 CPU OP1A OPIB should be connected to the positive side of a 5 24VDC external power supply OPIA should be connected to Ground on the external power supply OPIA and OP1B are the Output Power for Bank 1 The output can sink up to 25mA of current The device not shown on schematic 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 optocoupler SB the 10k resistor pulls up the output pin to the voltage supplied to OPIB Whe
47. ission of characters over RS 232 CW 0 or continue processing commands and lose characters 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 RIO Chapter 3 Communication e 13 Data Record QR and DR Commands 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 snapsh
48. le 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 this purpose and it has the following syntax SAh command string Here command string will be sent to handle h For example SAA XO 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 TE command the values will be stored in SAhO thru SAhn where n is the last field If a field is unused its SA value will be 2 31 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 generate
49. n current is flowing through the opto coupler CB the digital output drops to Ground supplied by OP1A and is able to sink up to 25mA of current 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 INCI Input Common Bank 1 for inputs 8 15 The series resistor limits the current through the PS2805 opto coupler The INCO and 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 3 3V INCO INC1 DI 7 0 DI 15 8 PS2805 RIO Chapter 4 I O e 19 26 pin D Sub Connector Analog I O Pin Label Description Pin Label Description Pin Label Description 1 N C No Connect 10 N C No Connect 19 N C No Connect 2 N C No Connect 11 N C No Connect 20 N C No Connect 3 AI7 Analog Input 7 12 GND Ground 21 AI6 Analog Input 6 4 AI4 Analog Input 4 13 AIS Analog Input 5 22 AI3 Analog Input 3 5 All Analog Input 1 14 AD Analog Input 2 23 AIO Analog Input 0 6 GND Ground 15 GND Ground 24 AO7 Analog Output 7 7 AOS Analog Output 5 16 AO6 Analog Output 6 25 AO4 Analog Output 4 8 AO2 Analog Output 2 17 AO3 Analog Output 3 26 AOI Analog Output 1 9 GND GND 18 AO
50. n internal 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 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 letter after that numbers are permitt
51. nds 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 15 List Program 000 A Program Label 001 SD14 Set bit 14 high 002 SB15 Set bit 15 high 003 MG DONE Print message 004 EN End Execute A 2001 SD14 Error on Line 1 TC1 Tell Error Code 130 Unrecognized Command This command doesn t ED Print line number where problem occurred RIO Chapter 4 I O e 27 1 00 The error occurred on line 1 of the program Program Flow Commands The RIO provides instructi
52. ne et Meca ee irn 9 Comimu nication Protocols aatal aaa 9 0 S 9 Email from the RC tt ARE en nsc tte 10 Communicating with Multiple Devices 10 RIO s Modbus Master eu Deseo t pM di eto nd sei uae tates 11 RIO ds Modbus Slave ote tetas deena taeda Peto cid hte Me un edel ad 12 Handling Communication BETOLDS An erit De sd pa e ees 12 T eet LM 13 Unsolicited Message Handling ioo ete eer reet tetas eere uei peer dip Pots 13 Other Protocols Supported en ee e de o ride e Ree eden eases lisent 13 DATA SPCORDO attt Ce one Len rt 14 Olcand DR 6 14 RIO Data a 14 Explanation of Status Information 15 CHAPTER 4 rr 17 INTRODUCTION ood ne estas el gotten dedu t fel o Ec eM Ars l 17 SPECIFICATIONS le dE eee tease nga o b n oot vend end 17 44 pin D Sub Connector Digital 17 High Power Sourcing Outputs 0 7 eese 7 18 Low Power Sinking Outputs 8 15 oe eror dires inner 19 19 pin D Sub Connector Analog JO 20 26 Analos Outputs 0 9 V range E BR ean 20 Analog Inputs 0 9 0 d eae AE 20 21 Analog Process Control Loop tein Pulse Counter pc 22 OVERVIEW M 23 EDITING PROGRAMS
53. nhibit This handshake procedure is required and ensures proper communication especially at higher baud rates 8 Chapter 3 Communication RIO 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 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 received 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
54. nput 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 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 keywords 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 RIO Chapter 4 I O e 35 TEST 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 fr
55. ntire I O status EN End program 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 make 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 RIO Chapter 4 I O e 29 Logical operators o O greater than O qua O lt ess than or equal to lt gt lt greater than or equal to 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
56. ons 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 MG Loop stops RIO ININT2 MG Blinker stops WT10000 RI1 1 Examples Interrupt Instruction Interpretation A Program Label XQ B 1 Execute B in thread 1 II1 0 1 amp 3 in thread 0 when input 1 low and input 3 high 2 1 5 amp 10 ININT2 in thread 1 when input 5 low and
57. ot of the controller s I O 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 1 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 14 Chapter 3 Communication RIO UW Analog In Channel 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 SL Signed Long Word 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
58. p 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 or null modem Ethernet cable or to a network hub with a straight through Ethernet cable RIO Chapter 2 Getting Started e 5 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 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 a crossover or null modem Ethernet 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
59. ppendix Electrical Specifications Input Output See Chapter 4 Power Requirements 18 36 VDC Typical 2 5 Watts Max 4 Watts Performance Specifications Variable Range 2 billion Variable Resolution 1 104 Variable Size 126 variables Array Size 400 elements 6 array names Max Program Labels 62 Program Size 200 lines x 40 characters RIO Appendix e 49 Connectors on the RIO 44 pin D Sub Connector Description Description Description Digital Input 15 No Connect 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 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 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 26 pin D Sub Connector 12 24V O
60. pt 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 750 command at the end of the ININT1 routine Auto Start Routine The RIO has a special label for automatic program execution 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 AUTO Automatic Program Execution on power up AUTOERR Automatic Program Execution on power up if error condition occurs ININTn Input specified by II goes low
61. ray 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 A 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 LOOP COUNT lt 10 Loop until 10 elements have been stored EN End Program The above example records 10 input bit values for bank 0 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 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 typ
62. ror 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 _ 10 1 is invalid Special Operands Keywords The RIO provides a few additional operands that give access to internal variables that are not accessible by standard RIO commands F Returns serial of the board _BN Returns the number of arrays available _DL DL Returns the number of available labels for programming 38 Chapter 4 0 RIO 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 Note All these keywords have corresponding commands except for TIME Examples of Keywords V1 DA Assign V1 the number of available array names V3 TIME Assign V3 the current value of the time clock Arrays For storing and collecting numerical data the RIO provides array space for 400 elements 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
63. s 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 port other than what is specified by the CF command add an Eh or 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 RIO as Modbus master An additional protocol layer is available for speaking to I O devices Modbus TCP is an Ethernet protocol that combines information in binary packets that are sent as part of a TCP IP packet The Modbus protocol has a set of commands called function codes The RIO as a Modbus master supports the 10 major function codes Function Code Definition 01 Read Coil Status Read Bits 02 Read Input Status Read Bits 03 Read Holding Registers Read Words 04 Read Input Registers Read Words RIO Chapter 3 Communication e 11 05 Force Single Coil Write One Bit 06 Preset Single Register Write One Word 07 Read Exception Status Read Error Code 15 Force Multiple Coils Write Multiple Bits 16 Preset Multiple Registers Write Words 17 Report Slave ID The RIO provides three levels of Modbus communication The first level allows the user to create a raw packet and receive raw data It uses the MBh command with a funct
64. s 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 LOOP JP LOOP EN TCPERR MG P1 _IA4 RE Interpretation Simple program loop Ethernet communication error auto routine Send message to serial port indicating which handle did not receive proper acknowledgment Return to main program Note The TCPERR routine only detects the loss of TCP IP Ethernet handles not UDP 34 Chapter 4 0 RIO Mathematical and Functional Expressions Mathematical Operators For manipulation of data the RIO provides the use of the following mathematical operators Operator Function _ i Subtraction Multiplication 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 COS 45 40 28 28 K IN 1 amp OIN 2 K is equal to 1 only if Input 1 and I
65. served o0 JP6 AUX Power for board comes from 2pin Molex Connector 18 36V 4 jumpers DC JP7 PoE Power for board comes from Power over Ethernet No power 4 jumpers cable is necessary Ethernet cable with PoE Switch is required 52 e Appendix RIO RIO Dimensions 3 88 PWR EI EJ NK ERREN EACT pos UB BE PESE 20019 42006 m 01 41 NC E jo Dosa 20014 2 bola DOZEN 38 DO15 pics 1 37 INCO 36 DI2 do prey EDE 35 DIS nn o nm 34 NIC DI 4 20 prea Bi OO 520115 31 004 EXT POWER SERIAL 18 36VDC ETHERNET PoE RIO 47100 DIGITAL 15 OPOA 30 14 001 29 002 13 004 28 005 12 007 27 11 OP1A 26 008 10 0010 25 0011 90013 24 0014 8 23 NIC 7 DIO 22011 6 DI3 21 DI4 5016 20 017 4 NIC 19 INC1 3019 18 0110 20112 17 0113 10115 16 26 AO1 25 A04 24 AO7 23 ATO 22 21 AI6 20 NC 19 ANALOG 9 GND 18 A00 8402 17 7 A05 16 6 GND 15 GND SAT 14 12 4 AI4 13 AIS SAI7 12 GND 2N C 11 NC NC 10 N C GALIL MOTION CONTROL MADE IN USA 5 24VDC 5 24VDC OR GND GND GND INC1 5 24VDC OR GND 12 24VDC DO 15 8 OPTA INCO OP1B OUTPUT SOURCE DO 70 500mA SINK 25mA Accessories and Options RIO
66. ss 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 of 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 RIO Chapter 3 Communication e 9 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 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
67. terrupt Function The RIO provides an input interrupt function which causes the program to automatically execute the instructions following the ININTn label where n ranges from 0 to 3 This function is enabled using the II n m condition command where n specifies the ININTn subroutine to be executed when the interrupt occurs The m argument specifies the thread number in which the interrupt subroutine ININTn is going to be executed Note that this thread needs to be executing at the time of the interrupt otherwise the ININTn subroutine will not have any thread to run in and will be ignored Condition is any number of inputs separated by the amp operator A positive input number means the RIO looks for that input to go high to satisfy the interrupt condition and a negative number means low For more on the II command refer to the command reference For example II1 0 3 amp 5 sets up the conditions of input 3 going high and input 5 going low for the interrupt to occur at ININT1 in thread 0 main The Return from Interrupt RT command is used to return from this subroutine to the 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 Analog Inputs Analog inputs are accessed with the AN n function where n is the number assigned to the analog inp
68. tion 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 8 07 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 56 e Appendix RIO THIS PAGE LEFT BLANK INTENTIONALLY RIO Appendix e 57 Index A Absolute Value 32 38 Address 56 Jumpers 8 Arithmetic Functions 24 31 36 39 Array 1 24 28 31 36 46 50 Automatic Subroutine 33 B Baud Rate 6 8 Bit Wise 36 C Circular Interpolation 41 Clock 40 Code 39 Command Summary 40 41 Communication Baud Rate 6 8 Handshake 8 Serial Ports 5 6 Conditional jump 24 29 47 Coordinated Motion Circular 41 Cosine 40 Cycle Time Clock 40 D Debugging 27 Digital Input 38 47 Digital Output 38 46 Dip Switch Address 56 Download 24 41 E Edit Mode 28 Error Code 39 F Formatting 43 Function 24 30 31 Functions Arithmetic 24 31 36 39 H Hardware 46 Address 56 Output of Data 43 I O Digital Input 38 47 Digital Output 38 46 Output of Data 43 Input Interrupt 30 Input of D
69. ut channel The returned value will be a voltage reading with 12 bit resolution The standard voltage range is 0 to 3VDC Note When analog input 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 12 bit module the equation used to determine the decimal equivalent of the analog voltage is as follows N V V10 4095 Vhi V10 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 0V 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 configures the analog inputs to be either 8 single ended default or 4 differential inputs 46 e Chapter 4 0 RIO The AA command is a trippoint that halts program execution until the specified voltage on an analog input is reached 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 Instruction Instruction JP C OAN 1 gt 2 Jump to A if analog input number 1 is greater than 2 volts MG AN 2 Display the analog volt
70. ut 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 variables can be formatted using the specifier Sn where n is the number of characters 1 thru 6 For example MG STR S3 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 42 e Chapter 4 0 RIO If the value of the variable RESULT is equal to 4 1 this statement returns the
71. utput Power Supply for DO 0 7 Pin Label Description Pin Label Description Pin Label Description 1 N C No Connect 10 N C No Connect 19 N C No Connect 2 N C No Connect 11 N C No Connect 20 N C No Connect 3 AI7 Analog Input 7 12 GND Ground 21 AI6 Analog Input 6 4 AI4 Analog Input 4 13 AIS Analog Input 5 22 AI3 Analog Input 3 5 All Analog Input 1 14 AD Analog Input 2 23 AIO Analog Input 0 6 GND Ground 15 GND Ground 24 AOT Analog Output 7 7 AOS Analog Output 5 16 AO6 Analog Output 6 25 AO4 Analog Output 4 8 AO2 Analog Output 2 17 AO3 Analog Output 3 26 AOI Analog Output 1 9 GND GND 18 AOO Analog Output 0 50 Appendix RIO J2 RS 232 Port DB 9 Pin Male Standard connector and cable 9Pin Signal e es ple Note A straight thru serial cable should be used to connect the RIO to a standard PC serial port to pinl pin2 to pin 2 etc J1 Ethernet Port 10 100 Base T RJ 45 10 100 BASE T Kycon GS NS 88 3 5 JS Power 2 pin Molex for 18 36VDC if not using Power over Ethernet CS VDC 18 36V y 2 DC GROUND 18 36VDC RIO Appendix e 51 Jumper Description for RIO JP5 MRST Master Reset enable Returns RIO to factory default settings and erases EEPROM Requires power on or RESET to be activated LIE June PI corrupt 192 Set baud Rate to 19 2k default without jumper is 1 15k LL OB Re
72. 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 board provides 126 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 _ IN 1 Assigns value of digital input 1 status to variable input 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 however 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 TEMPI POINT Invalid Variable Names REALLONGNAME Cannot have more than 8 characters 123 Cannot begin variable name with a number STATZ Cannot have spaces in the name RIO Chapter 4 I O e 37 Assigning Values to Variables Assigned values can be numbers internal variables and keywords functions RIO board parameters and str
73. ve for a description of the function codes If the third level of ModBus communication is used to communicate from a Galil master device to a slave RIO then the I O number calculation is as follows I O Number HandleNum 1000 BitNum where the bit number is from 0 to 15 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 or UDP communication is lost the TCPERR routine will automatically execute The TCPERR routine should be ended with the RE command 12 e Chapter 3 Communication RIO 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 TA gt u command Unsolicited Message Handling Unsolicited messages are any messages that are sent from the controller that are not directl
74. ver 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 equivalent to the Internet client and the term slave is equivalent to the Internet server 10 Chapter 3 Communication RIO An Ethernet handle is a communication resource within a device The RIO can have a maximum of 3 Ethernet handles open at any time If all handles are in use and a 4 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 connect to the slave Ex 151 25 255 9 lt 179 gt 2 This will open hand
75. xecuted 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 IF 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 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 ELSE 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
76. y requested by the host PC An example of this is a MG or TP command inside of a program running on the controller Error messages 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 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 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 transm
Download Pdf Manuals
Related Search
Related Contents
LE-380 Bakoon Products 取扱説明書 Acer 600 Series Laptop User Manual JVC RV-NB70 + ー - ウィンカーリレー ブレーキランプリレー サムズ公式サイト Manual de Servicio de Climatización 取扱説明書 - 横浜無線株式会社 Commissioning Switching on Changing the parameters Set 【製品名】 - テクニカルサポートQQ-Web Copyright © All rights reserved.
Failed to retrieve file