Home
User Manual PROGRAMMABLE REMOTE INPUT/OUTPUT
Contents
1. Request Response Field name Value Hex Field name Value Hex Slave address 0x80 Slave address 0x80 Function 0x17 Function 0x17 Read starting address HI 0x00 Byte count 0x02 Read starting address LO 0x00 Value of register 0x0000 HI 0x00 Quantity to read HI 0x00 Value of register 0x0000 LO 0x00 Quantity to read LO 0x01 Checksum HI 0x81 Write starting address HI 0x01 Checksum LO OxAA Write starting address LO 0x00 Quantity to write HI 0x00 Quantity to write LO 0x01 Byte count 0x02 Value of register 0x0100 HI OXFF Value of register 0x0100 LO OXxFF Checksum HI OxB8 Checksum LO Ox9E Page 67 SLAM CRIO v3 0 User Manual 9 FREQUENTLY ASKED QUESTIONS 9 1 Communication with the board can not be established If communication can t be established check the following points 1 2 9 2 Check RS 485 bus wiring in SIAM CRIO board and in all the other devices in the bus other boards RS232 485 converters etc Check that configuration jumpers in the board are correctly adjusted a Bus termination resistor must be active only in the first and last devices in the RS 485 bus b Pull up and pull down resistors must be active in only one device in the bus If still there s no communication watch communication diagnostics LEDs a If RX LED is not lit then the board is not receiving data from the bus
2. Page 42 SIAM CRIO v3 0 User Manual 7 4 Memory areas The operands which follow the instructions can be either constant values or belong to one of these memory areas Area Description Size words Range I Inputs memory 9 IWO Y IW8 Q Outputs memory 1 QWO0 MN RAN user memory non persistent 256 MWO MW255 V_ EEPROM user memory persistent 256 VWO VW255 S System memory 256 SWO SW255 Reading registers outside the values displayed in this table for example IW9 will cause no error but will always return 0 Accordingly writing to any non valid register will cause no change at all As can be shown in the instructions table some instructions like ST S R can operate on inputs memory This can be useful to simulate or force signals in some situations The system memory is mostly a read only area Writing on most registers will cause no effect and no error as well The other areas have read write access The V memory persistent is really in the RAM memory of the microcontroller but its periodically written to the EEPROM The number of writings in the EEPROM is limited and must be minimized in order to maximize the endurance of this non volatile memory Because of this the dumping of V memory to EEPROM is performed once per hour This big time can cause the loss of important data if a power failure happens before the dumping takes place To av
3. Bit Description S4 0 Pulse with 1 ms period 1000 Hz S4 1 Pulse with 2 ms period 500 Hz S4 2 Pulse with 4 ms period 250 Hz S4 3 Pulse with 8 ms period 125 Hz S4 14 Pulse with 16384 ms period S4 15 Pulse with 32768 ms period Page 46 SIAM CRIO v3 0 User Manual Register Description SW5 Scan cycles counter read only Starts at 0 when board enters RUN mode and increments every scan cycle overflowing at 65535 SW6 Configuration switches read only On startup the configuration dip switches are mapped to this register see section 5 Bit Description S6 0 Modbus address bit 0 see section 5 1 S6 1 Modbus address bit 1 S6 2 Modbus address bit 2 S6 3 Modbus address bit 3 S6 4 Modbus address bit 4 S6 5 Modbus address bit 5 S6 6 Modbus address bit 6 S6 7 Modbus address bit 7 S6 8 Baud rate switch Si see section 5 2 S6 9 Baud rate switch S2 S6 10 Baud rate switch S3 S6 11 User switch see section 5 3 S6 12 Not used S6 13 Not used S6 14 Not used S6 15 Not used SW7 Last scan cycle time in milliseconds read only SW8 Maximum scan cycle time in milliseconds read only Reset by setting S1 2 SWY SW10 SW11 Reserved Program counter read only SW12 Program error code read on
4. SIAM CRIO v3 0 PROGRAMMABLE SIAM REMOTE Kgl I NPUT OUTPUT CONTROLLER User Manual Version 3 0 SIAM CRIO v3 0 User Manual CONTENTS 3 INSTALLATION EEN 8 WIRING iscssicseriacctcnnonacnetvansandeanuesstanemneueusmumasauwerwascndsanseensseeiawawerumnsenicuresediuues 9 4 1 Main power ECHT UE 9 4 2 COMMUNICATION ET 10 4 2 1 RS 485 ET 10 4 2 2 RS 232 MOGUIC E 11 4 3 Digital OU TT 12 4 4 Digital input ninnaa a aaa TESTEN Eed K EN 14 4 5 Analog InpUfeegegeg eerieugeregg d e EEN line 15 4 6 WINING E ET LEE 18 Bele BUS CI EEN 19 5 2 Ba d E 20 5 3 User defined switch EE 20 5 4 Communication resistors 2 ee eeeeeeR geed EE nie 21 5 5 Reset SWICK vise aeina eon Seas can edel dE dE lee 21 6 L OM ModE EE 23 6 2 Inputs and outputs ossiani eaaa iaaa iaa SEE EEEa NAN Eed AEN 24 6 3 RAM memory A EE 25 6 4 EEPROM memory NI RANNER ENEE I tartenn nAnnAAAEEAAAEEESAAAEANENENEANEEEA RANEA E 25 6 5 System MeMoOFy EE 25 6 6 Virtual registers oeaan a a enti asa 26 ELE LEE ER et CONTIQUIATION MEET 27 6 8 1 Communication and program 28 6 8 2 Persistent virtual registers AAA 29 6 8 3 Analog inputs scalimg AE 31 Le POC CL 32 6 10 Other device Options is esaciisidiss icine ege NEESS Eege didi 35 7 LEC PROGRAMMI NG TT 7 1 The instruction list IL Longouange NNN 36 72e Datatypes EE 37 7 3 Ne e e ET 37 7 4 ue NI EE 43 7 4 1 Wu ER EE 44 TAZ Outputs MOMONY iiss sess se s
5. Q_FALLO_COM AT Q0 7 BOOL BOOL BOOL Zona de lectura de Pic Bei CENIT_ABRIENDO AT 29040 0 BOOL CENIT_ABIERTOS AT X MO 1 BOOL CENTT ERRANDA AT WMA 2 RONI Eok cenitales abiertos Inv 1 cenitales Cerrados Inv 1 Bei anemometro OK Zei Selector Contro centra Cenitale Selector contro centra Frioa Selector Contro central Fotoperi contro Loca Abrir cenitales Inv contro Loca Cerrar cenita les mn contro Loca Frio Inv 2 contro Loca Calor Inv 1 Sei contro Loca Fotoperiodo 2 Inv contro Loca Fotoperiodo 2 Inv Termicos OK Inv i Sei Tension 24V2 Salidas OK Gei Abrir centa Inv 1 Sei cerrar Cenitad Inv 2 Sei Extractor Inv 2 Sei Somba cooler Inv 1 Sei Bomba calefaccion Inv 2 Sei Fotoperiodo i Inv i Sei Fotoperiodo 2 Inv 2 Sei Fallo Comunicaci n PLC Inv 2 Sei cenitales abriendo Inv i Bei cenitales abiertos Inv i Bei Cenitalas carranda Trav 7 Sai Line 1 Col 1 Offline program editing In the lower part of this window we can see the line and column number the size of the program in instructions and bytes if the program can be compiled succesfully the checksum and the current viewing mode offline editing or online monitoring After typing in the IEC program it must be compiled by selecting the option Compile in the Device menu or by clicking the button If the program has errors these will be displayed in the bottom part of the CRIOSoft window If not
6. SW75 Board model ID read only This value identifies the model of the board 7001 for this model SW76 Hardware version read only SW77 Firmware version read only SW80 SW81 Modbus diagnostic counter for frames detected in bus read only This is a 32 bit counter SW80 high word SW81 low word Can be reset by setting bit S71 1 SW82 SW83 Modbus diagnostic counter for frames addressed to slave read only This is a 32 bit counter SW82 high word SW83 low word Can be reset by setting bit S71 1 SW84 SW85_ Modbus diagnostic counter for incomplete frames addressed to slave read only This is a 32 bit counter SW84 high word SW85 low word Can be reset by setting bit S71 1 SW8E SW87 Modbus diagnostic counter for frames addressed to slave with checksum errors read only This is a 32 bit counter Y SW86 high word SW87 low word Can be reset by setting bit S71 1 SW88 SW89I Modbus diagnostic counter for frames addressed to slave with parameter errors read only This is a 32 bit counter YSW88 high word SW 89 low word Can be reset by setting bit S71 1 SW90 SW91 Modbus diagnostic counter for frames addressed to slave not supported read only This is a 32 bit counter Y SW90 high word SW91 low word Can be reset by setting bit S71 1 Page 49 SLAM CRIO v3 0 User Manual Regist
7. 109 RET without CAL 110 End of program with open parenthesis All open parentheses must be closed before reaching the end of the program Page 51 SLAM CRIO v3 0 User Manual 111 End of program inside subroutine The END instruction must be used only in the main program level and n 112 Instruction not allowed inside parenthesis Program control instructions JMP CAL RET LOOP can not be used inside parentheses Page 52 S 7 6 Programming examples IAM emeng SLAM CRIO v3 0 User Manual 7 6 1 Simple automatic door The next example program would control a motorized door or blind with two pushbuttons raise and ower and two limit switches up and down VAR_GLOBAL In PB RA PB LO SWITC SWI TC 0u RAISE LOWER END_VAR PROGRAM Mai LD ANDN ST LD ANDN ANDN ST END END PROGRAM uts ISE AT 0 0 BOOL WER AT 0 1 BOOL H_UP AT 0 2 BOOL H_DOWN AT 0 3 BOOL tputs AT Q0 0 BOOL AT Q0 1 BOOL n PB RAISE SWITCH UP RAISE PB LOWER Swi TCH DOWN RAISE LOWER e Ze Raise Lower Limit Limit Raise Lower pushbutton pushbutton switch up switch down command command Page 53 SLAM CRIO v3 0 SIAM User Manual PS TECNOL E 7 6 2 Automatic door with local and remote control Now the automatic blind has a oca control by pushbuttons and a rem
8. ACC 0 XOR D 3 6 D e D 3 Nesting more than 4 parentheses or reaching the end of the program with any non closed parenthesis will cause a fatal error which will stop program execution Parenthesis must be open before being closed otherwise a fatal error will stop program execution gt If operand is 0 a fatal error will stop program execution 6 Can be used with or without operand Page 39 SLAM CRIO v3 0 User Manual Compare Data types Memory areas 5 g t S Description g e c 1 Qq mM v D o Ki g x B 6 Si e Ar S E E l gl l 2 2 8 8 SHL e 1 4 e o o o o o e o o o Shifts operand one bit to the left OP OP lt lt 1 If used without operand shifts ACC ACC ACC lt lt 1 SHR e 1 4 e o o o e o e o o o Shifts operand one bit to the right gt gt 1 instructions OP OP gt gt 1 If used without operand shifts ACC ACC ACC GT GE EQ NE 3 6 3 6 3 6 Sets RLO to TRUE if ACC is greater than the operand Otherwise sets RLO to FALSE Sets RLO to TRUE if ACC is greater or equal than the operand Otherwise sets RLO to FALSE Sets RLO to TRUE if ACC is equal to the operand Otherwise sets RLO to FALSE Sets RLO to TRUE if ACC is not equal to the operand Otherwise sets RLO to FALSE LE Sets RLO to TRUE
9. There can be a problem with wiring or the modbus master is not sending data maybe it s stopped or not properly connected b If the RX LED lits but the TX LED doesn t then the SIAM CRIO board is not responding to the modbus requests This can happen if the requests are not addressed to the correct modbus slave Check the slave address the master is trying to communicate to If all is correct then the communication problem can be due to a hardware problem If the main state LED is not blinking then the microcontroller can be damaged If it blinks but communication is still not possible then maybe some communication component in the board has stopped functioning maybe because some overvoltage in the bus Digital outputs are all inactive Check the online status of the outputs with the monitoring software If the outputs are not active in the software then make sure that the program is activating them If they are but their corresponding LEDs are not active check the outputs power supply terminals to see if you re supplying power to them 9 30VDC See section 4 3 for a detatiled description of of digital output connectors Page 68 SLAM CRIO v3 0 SIAM User Manual Pen TECNOL TE 9 3 The IEC code is not executing correctly If the instruction are not executed in an unexpected way it s probably because the logic accumulator RLO has the value FALSE This disables execution of some instructions for example all the
10. remote I O module and PLC can be combined to perform a descentralised control The SiAM CRIO module has 12 digital outputs DO 16 digital inputs DI and 8 analog inputs AI which are multiplexed with digital inputs 8 15 Up to 255 SIAM CRIO modules can be connected in a modbus network although this protocol only allows addressing of 247 nodes So in a modbus network we could have a maximum of 2964 digital outputs 3952 digital inputs and 1976 analog inputs There are two available versions of the module one with RS 485 port 3 way screw connector and another one with RS 232 port DB9 male connector The configuration programming and monitoring of the module can be done with the SiAM CRIOSoft software which can be freely downloaded from www siam es Page 5 SIAM User Manual This picture displays the RS 485 module version with its LEDs and connectors Connector and LEDs for digital inputs DIOO DI07 Connector and LEDs for digital inputs DIO8 D115 and analog inputs AIO AI7 Connector and LEDs for digital outputs DOOO DO05 Connector and LEDs for digital outputs DO06 D011 Communication bus status LEDs Communication bus connector RS 485 Power and module status LEDs Power connector Configuration switches 1 2 3 4 5 6 7 8 9 Page 6 SLAM CRIO v3 0 SIAM User Manual The RS 232 module version only differs in the communication connector as can be seen in this pic
11. 1 fast blink RUN mode Program is executing correctly with no error 0 1 seconds on 0 5 seconds off 2 fast blinks RUN mode Program is executing with warnings Use the programming software to determine the warning condition 3 fast blinks STOP mode Program execution was aborted because of programming errors Use the programming software to determine the error condition This LED must be always blinking If it s always on or always off then there is a hardware problem and the board must be repaired Page 9 SIAM SLAM CRIO v3 0 User Manual TECNOLOGICI 4 2 Communication 4 2 1 RS 485 module This version uses a 3 way screw connector described in the following figure to implement a 2 wire bus Connector Description RS 485 positive terminal also known as 485 A line or modbus DO line RS 485 negative terminal also known as 485 B line or modbus D1 line iH Cable shield It s internally connected to power supply ground bus TX and RX LEDs will indicate the status of the communications The TX LED will turn on when the device is transmitting data to the RS 485 The RX LED will turn on when data is received from the RS 485 bus Only valid serial data detected in the bus will turn this LED on If there is traffic in the bus at a different baud rate that the one configured in the slave this LED will stay off As in any RS 485 network bus
12. 3 Any combination of digital analog inputs is possible Do not connect a digital input voltage 24V to an analog configured input Connecting any analog input to a voltage higher than 5V can cause damage to the board On the other hand connecting an analog voltage 0 30V to a digitally configured input is not dangerous for the board Page 16 SLAM CRIO v3 0 User Manual Analog inputs are converted with 10 bit resolution scaled and mapped to 16 bit registers accessible by both the IEC user program IW1 IW8 and modbus communication These inputs are also thresholded and mapped to the digital input register bits 7 15 The scaling to the 16 bit registers is performed by a linear conversion whose range can be configured with the programming software By default the predefined range is 0 10000 So OV OmA will be converted to a 0 value and 5V 20mA will be converted to 10000 But this range can be changed to any signed word value between 32768 and 32767 The unscaled 10 bit conversion value 0 1023 can also be accessed in system registers SW30 SW37 Page 17 4 6 The following diagram displays an example of the connection of the board SLAM CRIO v3 0 SIAM User Manual KH M e a Wiring example Outputs Q0 2 and Q0 5 are commanding two 24VDC relays Input I0 0 is connected to a switch Input I10 1 is connected to a sensor with a normally open contact Analog inputs I
13. conditional instructions which end in C like JMPC CALC RETC To avoid this after finishing a logical segment of the program typically with a store instruction like ST or STN place an instruction to start the new logical segment with the RLO value to TRUE This can be done with LD TRUE or better with an S instruction SET without operand which consumes less program memory Page 69 SIAM CRIO v3 0 User Manual 10 ELECTRI CAL CHARACTERISTICS Parameter Min Typ Max Units Temperature range 0 70 oC Supply Main supply voltage Vin 9 24 30 V Current consumtion 15 110 mA Power consumption Vin 9 VDC 0 1 1 W Power consumption Vin 12 VDC 0 2 1 3 W Power consumption Vin 24 VDC 0 4 2 6 W Digital inputs Input impedance 3 9 Per input current consumption Viy 9VDC 2 3 mA Per input current consumption Viy 12VDC 3 1 mA Per input current consumption Vin 24VDC 6 2 mA Analog inputs Input impedance Current mode 0 20mA 250 Q Digital outputs Outputs supply voltage Vous 9 24 30 V Maximum output current 80 mA Program Program memory 8192 bytes gt 1300 IEC instructions Non retentive RAM user memory 256 words Retentive EEPROM user memory 256 words EEPROM durability 100K 1M Writes Maximum par ntesis nesting levels 4 Maximum subroutine nesting level
14. data types and which memory areas supports and also the size in bytes of the instruction The size of the instruction depends on the data type of the operand so minimum and maximum sizes are shown The maximum size of any instruction is 6 bytes Besides for each instruction it s shown if the instruction is a standard IEC instruction or not Instructions like INC DEC CLR are not standard but have been included because they allow common operations very easily with only one instruction instead of several Some instructions can be used with or without an operand If used with operand they perform operations on the operand If used without operand they perform the same operations on the RLO or the ACC Page 37 SLAM CRIO v3 0 User Manual Rt 1 4 Lo ic in Data types Memory areas 5 9 t S Description E lt 2 c i Q M vis bh u 8is g Sll j l glS el t alale Transfer instructions LD e 3 6 e e o o e o o o o e o o o Load operator value in RLO if boolean or in ACC otherwise LDN H 3 6 o D D D D D D D e D e D D D Load negated operator value in RLO if boolean or in ACC otherwise ST D 3 6 o D e D D D D D e D D e Store value from RLO if boolean or ACC otherwise in operand STN D 3 6 o D D D D D D D e D e Store negated value from RLO if boolean or ACC otherwise in operand S e 1 4 o e e e o e Sets operand to TRUE
15. if ACC is lower or equal than the operand Otherwise sets RLO to FALSE LT Sets RLO to TRUE if ACC is lower than the operand Otherwise sets RLO to FALSE Program control instructions JMP Jumps unconditionally to address indicated by the operand JMPC Jumps conditionally when RLO is TRUE to address indicated by the operand JMPCN Jumps conditionally when RLO is FALSE to address indicated by the operand CAL Calls unconditionally subroutine in address indicated by the operand CALC Calls conditionally when RLO is TRUE subroutine in address indicated by the operand CALCN 7 Can be used with or without operand 8 If more than 4 calls are nested a fatal error will stop program execution indicated by the operand Calls conditionally when RLO is FALSE subroutine in address Page 40 SIAM CRIO v3 0 User Manual Data types Memory areas Dags E S g H S Description E EI C IIOD MINIS t ol elal alal g Slel a KS o SZ Ere ea E LOOP 4 D e Decrements ACC and jumps to address if ACC is 0 LOOPN 4 D e Decrements ACC and jumps to address if ACC is not 0 RET e 1 Ends subroutine unconditionally and returns to instruction after CAL RETC e 1 Ends subroutine conditionally when RLO is TRUE and returns to instruction after CAL RETCN e 1 Ends subroutine conditionally
16. then we can transfer the program to the board by selecting the Download in the Device menu or clicking amp Page 32 SIAM CRIO v3 0 SIA M User Manual TECNOL TE The program can be monitored by entering in online mode But for this to be possible the program in CRIOSoft and in the SIAMCRIO board must be identical If they are not a message will show up to indicate that program online monitoring is not possible when entering in online mode In any case the program window will become read only and the program will not be modifiable until getting back to offline mode If the programs in the PC CRIOSoft and PLC SIAM CRIO are equal then the program window will change its appearance when entering online mode and will look like like this Une Code Operand RLO 244 Saita ai Final st esta en modo aprendizay ea 245 LD APREN_COMENZADO 1 246 JMPC FIN 546 247 248 PET esta abierto poner e tiempo total 249 LD I_CEN_OPEN 250 JMPC CEN OPEN 251 257 SEI esta cerrado poner e tiempo a DS 253 LD I_CEN_CLOSED 254 JMPC CEN_CLOSE 2599 256 Incrementa Timer ei esta abriendo 257 LD FLAG_1S 258 AND CENIT_ABRIENDO 259 ANDC 260 LD T_ACUM_CENIT 261 LT T_TOTAL_CENIT 262 J 263 JMPC INCREM_TIMER 264 265 pecrementa Timer s7 esta cerrando 266 LD ELAG LS 267 AND CENIT_CERRANDO 268 AND 269 LD T_ACUM_CENIT 270 GT 0 ZAL 272 GE Line 244 Col 1 Size 171 instructions 548 bytes Checksum Ox4B1D Onli
17. 0 Flag active one scan every 100 ms S2 1 Flag active one scan every 200 ms S2 2__ Flag active one scan every 500 ms S2 3 Flag active one scan every 1 second S2 4 Flag active one scan every 2 seconds S2 5 Flag active one scan every 5 seconds S2 6 Flag active one scan every 10 seconds S2 7 Flag active one scan every 15 seconds S2 8 Flag active one scan every 30 seconds S2 9 Flag active one scan every 1 minute S2 10 Flag active one scan every 1 hour S2 11 Flag active one scan every 1 day S2 12 Not used S2 13 Not used S2 14 Not used S2 15 Not used SW3 Time pulses register read only Bit Description S3 0 Pulse with 100 ms period 10 Hz S3 1 Pulse with 200 ms period 5 Hz S3 2__ Pulse with 500 ms period 2 Hz S3 3 Pulse with 1 second period 1 Hz S3 4 Pulse with 2 seconds period 0 5 Hz S3 5__ Pulse with 5 seconds period 0 2 Hz S3 6 Pulse with 10 seconds period 0 1 Hz S3 7 Pulse with 15 seconds period S3 8 Pulse with 30 seconds period S3 9 Pulse with 1 minute period S3 10 Pulse with 1 hour period S3 11 Pulse with 1 day period S3 12 Not used S3 13 Not used S3 14 Not used S3 15 Not used SW4 Milliseconds counter read only Starts at 0 when the board is powered up and increments every millisecond overflowing at 65535
18. 000 0x0000 0x0000 Bin 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 EG Write value Description This option displays a window like the previous one where we can see and modify the values of the non volatile registers in the V memory of the board 6 5 System memory This option displays a window like the previous one where we can see but not modify the values of the system registers in the S memory of the board Page 25 SIAM CRIO v3 0 S IAM User Manual TECNOL TE 6 6 Virtual registers This option displays a window similar to the previous ones where we can see and modify the virtual or indirect addressing registers of the board For any virtual modbus register we can see the real modbus register it points to as well as the value of the real register in decimal hexadecimal binary and ASCII formats We can also assign textual descriptions to the virtual registers 0 3 0 Omg wt Q 0 P RAR MIMP IAIA Gegen lt Right cl
19. A4 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00 i oox om o C The state of the digital outputs can i a be toggled by left clicking over them Both digital inputs and outputs can be forced Any forced input or output will display an F over it The forcing of an input or output must be done in online mode by right clicking over the corresponding indicator A popup menu will appear with options to force ON to force OFF to delete this force or to delete all forces Two more options will enable or disable the force masks These force masks are volatile that is are lost when the board is powered down Persistent forces of inputs and outputs can be done by means of the IEC user program Page 24 SIAM SIAM CRIO v3 0 User Manual TECNOLOGICI 6 3 RAM memory M The next option displays the volatile registers in the M memory in decimal hexadecimal binary and ASCII formats Right click over any register to display options to change its value delete it set to 0 and to assign a textual description The write values are stored when in offline mode and are automatically applied when switching to online mode 6 4 EEPROM memory V Di RAM memory Register Hex 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0
20. C MW POINTER MI OVW POINTER_V ACC Increment pointer Increment pointer a in E mm D 1 lt ze e Ze Copy LOOP ll lee e FH TTT l lt _ OW oO D D D 22 zZ Ln gogo gt 000 ZZ oOo If pointer below 50 OP then repeat loop Se Ss nn me e PC COPY_L MAI N_ PROG TRUE Start of main program END PROGRAM Page 60 SLAM CRIO v3 0 User Manual 8 MODBUS COMMUNI CATION 8 1 Modbus protocol Modbus is a master slave protocol which normally operates over a RS 485 bus In the bus there is only one device the master which initiates the modbus transactions in order to read or write data to the other devices the slaves The slave devices reply to the master with the requested data or with acknowledge or error responses This protocol has been chosed between many others because it s widespread use in the industrial area and because it s a well known easy to use well documented and free of use protocol The modbus specifications are public and can be downloaded from www modbus org Communication frames are limited to 256 bytes as the specification recommends This allows reading or writing of about 100 16 bit registers with a single transaction Serial communications must be configured with 8 data bits 1 stop bit and no parity Baud rate must be 4800 9600 19200 2880 38400 57600 115200 or 128000 bps In the event of err
21. ED will be off Page 12 SIAM CRIO v3 0 SIAM User Manual M e The use of independent power supplies for the electronics and the outputs allows the use of different voltages for example 24VDC for the electronics and 12VDC for the outputs In many cases though the same 24VDC power supply is used for both the electronics and the digital outputs For these cases the board can bypass the main power supply positive terminal to the output terminals This can be done with two internal jumpers shown in this figure a TEETE es e ee ZS Jumper Description J18 Bypass of main positive power supply to positive power supply for outputs DOOO DO05 J19 Bypass of main positive power supply to positive power supply for outputs DO06 D0011 If any of the bypass jumpers is closed don t connect the power supply terminals in digital output connectors connectors 1 2 4 5 in previous page to an independent power supply Doing so will short circuit the main power supply with the outputs power supply These jumpers bypass only the main power supply positive voltage The outputs power supply ground is always internally connected to the main power supply ground Digital outputs can be activated internally by the IEC user program QW0O or externally by modbus communication by writing a 16 bit register whose first 12 bits are mapped to the 12 digital outputs An active bit 1 in this register
22. FFF in register 0x0100 Request Response Field name Value Hex Field name Value Hex Slave address 0x80 Slave address 0x80 Function 0x06 Function 0x06 Register address HI 0x01 Register address HI 0x01 Register address LO 0x00 Register address LO 0x00 Register value HI OXxFF Register value HI OxFF Register value LO OXxFF Register value LO OXxFF Checksum HI del Checksum HI Ox9A Checksum LO 0x1B Checksum LO 0x1B 8 3 4 Write Multple Registers 0x10 This function code is used to write a block of contiguous registers This example as the previous one writes the value OxFFFF in register 0x0100 but using this function instead Request Response Field name Value Hex Field name Value Hex Slave address 0x80 Slave address 0x80 Function 0x10 Function 0x10 Starting address HI 0x01 Starting address HI 0x01 Starting address LO 0x00 Starting address LO 0x00 Quantity of registers HI 0x00 Quantity of registers HI 0x00 Quantity of registers LO 0x01 Quantity of registers LO 0x01 Byte count 0x02 Checksum HI Ox1E Value of register 0x0100 HI OXFF Checksum LO 0x24 Value of register 0x0100 LO OXxFF Checksum HI 0xDB Checksum LO 0x76 Page 65 SIAM CRIO v3 0 S IAM User Manual TECNOL TE 8 3 5 Mask Write Register 0x16 This function code is
23. WO and IWO are reading humidity and temperature from a 4 20mA analog transmitter 220VAC N VAC SIAMCRIO v3 0 POWER SUPPLY GND 485 485 hi SWITCH DVDC Fb MIN X shield Ge Get ES a amp d RELAY 24VDC A1 RELAY 24VDC A1 14 24VDC A Page 18 SLAM CRIO v3 0 SIAM User Manual H TECNOLOGICI 5 BOARD SETTI NGS 5 1 Bus address The first step to configure communication is to set up the slave address This can be done with the lower DIP switch bank shown in the picture PPr neute on the left mme There are 256 selectable addresses but only 12 3 Eege addresses between 1 and 247 are valid for the g hatena modbus protocol DIP switch 1 contains the least TS significant bit of the address and switch 8 To ers contains the most significant bit Set device address O to reset the user program In case of incorrect programming or configuration power up the board with all the switches OFF address 0 and user program will be deleted In this case the default board Sa se o o address will be set to 128 The program can then 9 be corrected and downloaded again LEAG Bus address must be configured for both the RS ourrurs l 232 and RS 485 versions of the module i Za On start up the bus address bank switch is mapped to system register SW72 which controls the effective address o
24. Word Int Dword Dint Real O Ke A D m Logical OR between RLO and negated result of parenthesis Bitwise logical XOR operation between operand and RLO if boolean or ACC otherwise XOR e 1 Logical XOR between RLO and result of parenthesis XORN D 3 6 o D D D D D e D e D Bitwise logical XOR operation between negated operand and RLO if boolean or ACC otherwise XORN e 1 Logical XOR between RLO and negated result of parenthesis D 1 End of parenthesis operation Arithmetic instructions ADD D 3 6 D D D D D D D D D e D D e Adds ACC to operand and stores result in ACC ACC ACC OP SUB e 3 6 e o e o o o o o o o o o Substracts operand from ACC and stores result in ACC ACC ACC OP MUL D 3 6 D D D D D D D e D e D e D Multiplies operand with ACC and stores result in ACC ACC ACC OP DIV D 3 6 D D D D D D D D e D D D Divides ACC by operand and stores result in ACC ACC ACC OP MOD e 3 6 e o o o o o e e o e o o Divides ACC by operand and stores remainder in ACC ACC ACC OP INC 1 4 e le o o o o e e o o o Increments operand OP OP 1 If used without operand increments ACC ACC ACC 1 DEC 1 4 e o o o o o e e e o o Decrements operand OP OP 1 If used without operand decrements ACC ACC ACC 1 CLR 1 4 e o o o o o e e e o o Sets operand to 0 OP 0 If used without operand sets ACC to 0
25. activates its corresponding output and an inactive bit 0 deactivates the output If both modbus communication and the user program are controlling the outputs normally the user program prevails due to its faster execution cycle Page 13 SLAM CRIO v3 0 S IAM User Manual TECNOLSGic 4 4 Digital inputs The board has 16 optoisolated digital inputs The connection of the inputs is done in the following connectors 1 2 Connector Description Comments 1 Connectors for digital inputs Connect here digital inputs DI00 D007 When the DIO0 DI07 corresponding input is active when the voltage in the terminal is 9VDC or higher its LED will be on Otherwise its LED will be off 2 Connectors for digital inputs Connect here digital inputs DI08 D015 When the DI08 DI15 corresponding input is active when the voltage in the terminal is 9VDC or higher its LED will be on Otherwise its LED will be off These inputs are multiplexed with analog inputs 0 7 which are also connected to this connector These group of inputs must be configured by hardware jumpers as described in the next section Input voltage for digital inputs must be between 9 and 30VDC referenced to the main power supply ground Digital inputs can be accessed internally by the IEC user program IWO or externally by modbus communication by reading a 16 bit modbus register whose bits are mapped to the 16 digital inputs An a
26. ample if we have a temperature transmitter whose range is with range 40 80 C and a 0 20mA analog output we can set the minimum and maximum scaling values to 4000 and 8000 Doing so in the scaled analog input register IW1 IW8 we would be able to e Ok Cancel read the real temperature value 4 multiplied by 100 Be sure to correctly configure the analog inputs with the internal switches as described in section 4 5 because connection of a high voltage 24VDC for example to any input configured as analog can cause damage the board Page 31 SIAM SIAM CRIO v3 0 User Manual M e 6 9 Program The program window allows editing of the instruction list user program and also its monitoring in online mode Program LvAR GLOBAL Entradas Be I_CEN_OPEN AT I0 0 BOOL I_CEN_CLOSED AT I0 1 BOOL I_ANEM_OK AT I0 2 BOOL I_SEL_CENTRAL_CENIT AT I0 3 BOOL I_SEL_CENTRAL_FRIO_CALOR AT I0 15 I_SEL_CENTRAL_FOTOP AT I0 5 BOOL I_OPEN_CENIT_LOCAL AT 1I0 6 BOOL I_CLOSE_CENIT_LOCAL AT I0 7 BOOL I_FRIO_LOCAL AT I0 8 BOOL I_CALOR_LOCAL AT I0 9 BOOL I_FOTOP1_LOCAL AT I0 10 BOOL I_FOTOP2_LOCAL AT I0 11 BOOL I_TERMICOS_OK AT I0 12 BOOL I_TENSION_24V_OK AT I0 13 BOOL e Salidas Gei Q_OPEN_CENIT AT Q0 0 BOOL Q_CLOSE_CENIT AT Q0 1 BOOL Q_EXTRACTOR AT Q0 2 BOOL Q_COOLER AT Q0 3 BOOL Q_CALEFACCION AT Q0 4 Q_FOTOPL AT Q0 5 BOOL Q_FOTOP2 AT 00 6 BOOL
27. board could not switch to RUN mode because it detected errors in the downloaded user program The program should be downloaded again to correct this error 102 Operation code not valid All the possible instructions see section 7 3 have a numeric code If the board detects an unknown code it stops execution and displays this error Normally this is checked by the compiler so this error normally indicates a problem in program memory 103 Operator area not valid Not all operator areas are valid for every instruction For example RTRIG or FTRIG instructions can only operate on M and V memory If some invalid combination is found this error stops program execution Normally this is checked by the compiler so this error normally indicates a problem in program memory 104 Operator type not valid Not all operator types are valid for every instruction For example S or R instructions can only operate on BOOLs If some invalid combination is found this error stops program execution Normally this is checked by the compiler so this error normally indicates a problem in program memory 105 Closure of non open parenthesis The instruction must be used only after opening the parenthesis with AND ORC or XORC Otherwise this error will stop program execution 106 Too many open parentheses No more than 4 parentheses can be nested 107 Too many nested calls No more than 4 CALs can be nested 108 Jump to wrong address
28. ction 6 8 3 SW150 Modbus link timeout in milliseconds read write See section 6 8 1 Page 50 SIAM CRIO v3 0 User Manual 7 5 Program errors and warnings There are some situations where the user program can not be correctly executed This case will be visually indicated by a different blinking of the board s status LED see section 4 1 but for a detailed description of the error it s necessary to connect online and open the device status window see section 6 7 All the possible errors and warnings are defined by a numeric code that is mapped to system register SW12 A value of 0 indicates no error or warning Any value between 1 and 99 indicates a warning and any value of 100 or higher indicates an error The possible values and error causes are these Code Description 0 Program execution OK no error no warning 1 Program empty This indicates that the board was requested to enter into RUN mode with no program downloaded Type conversion with possible information loss Invalid accumulator type for instruction Math operation not possible Division by zero If any DIV or MOD is executed when the ACC is zero this warning will appear eA A WwWIN 00 Maximum time exceeded watchdog If the user program execution time is longer than the specified watchdog timeout see section 6 8 1 then execution is stopped and this error will appear 101 Program checksum error The
29. ctive bit 1 in this register indicates that its corresponding input is active and an inactive bit 0 indicates that the input is not active Analog inputs are also mapped to this digital inputs register by comparing the analog value of the inputs So if an analog input is higher than 2 5V or 10mA then the corresponding bit in the digital input register will be active Page 14 SIAM User Manual 4 5 Analog inputs Analog inputs share the same connector for digital inputs DI08 DI15 They can be 0 5VDC voltage inputs referenced to the main power supply ground as shown here mg Wel ie REN en gege be Ke a 8 eription Comment ji Connectors for analog inputs onnect here analog inputs AIOO AI07 AI00 AIO7 They can also be 0 20mA current inputs as shown here BR OOOOOOOE In this case analog inputs are passive current inputs So the current transmitters will not be powered by the analog inputs and must be powered independently Page 15 SLAM CRIO v3 0 SIAM User Manual TECNOL meas Analog inputs must be configured by setting hardware jumpers inside the board There are 8 jumpers in the board one for each possible analog input displayed in the following picture CW Gei o o at SC Dauf 11 adeo NSL LL Kies ba ES P ANS LL To configure any input as analog close jumpers 1 2 To configure any input as digital close jumpers 2
30. d Power on set 204 d Watchdog he set 250 6 0 7 Meer ad iessed to slave H 1 k e Actual and maximum cycle time of Eeer SCH Incomplete hames EEPROM modified S0 9 Frames with checksum error Pr 50 10 Frames with wrong parameters the u ser p rog ra m S coan ron T ai RX 560 0 Frames not supported by slave e Communication error Overrun S60 1 Frames returned by slave e Im porta nt sta tu S b its Communication error Framing 2560 2 Gielen eror peny den ij m tion Buffer full e Running time counters Modbus enor Link enor 570 0 e U ser p rog ram stati sti CS a nd Reset errors Reset counters memory usage bar By clicking on the buttons in this window we can reset the maximum cycle time the running time and the most important errors If there is any error in the user program and the offline in CRIOSoft and online in the board programs match click over the error indicator panel to open the program window and jump to the instruction that generates the error 6 8 Configuration The most important configuration parameters for the board can be set in this window In the bottom part of the window there are buttons to Read and Write the current configuration to accept Ok or Cancel the changes made These parameters can only be changed in offline mode Page 27 SLAM CRIO v3 0 S IAM User Manual TECNOL TE 6 8 1 Communication and program In the first tab we can set paramet
31. e values are Value Baud rate bps 0 4800 1 9600 2 19200 3 28800 4 38400 5 57600 6 115200 7 128000 SW63 Serial port timeout in milliseconds read write SW64 Serial port received bytes read only Indicates the number of bytes received in the serial port buffer Page 48 SLAM CRIO v3 0 User Manual Register Description SW70 Modbus status register read only Bit Description S70 0 Link error This bit becomes active when there is no communication between the board and the modbus master in some time modbus link timeout see section 6 8 1 S70 1 Frame control error S70 2 Frame length error S70 3 Checksum error S70 4 Timeout error S70 5 Not used S70 15 Not used SW71 Modbus command register read write Bit Description S71 0__ Reset modbus errors in SW70 S71 1 Reset modbus diagnostic counters S71 2 Not used S71 15 Not used SW72 Modbus slave address read write On startup this setting is read from dip switches see section 5 1 but can be overwritten by user program at any time Valid values are 1 246 SW73 Modbus initial delay read write On startup the board waits for this time in milliseconds before starting communications SW74 Modbus reply delay read write After receiving a modbus request the board waits for this time in milliseconds before sending the reply
32. eal and virtual registers is persistent so it s not lost on power down Page 29 SLAM CRIO v3 0 User Manual SIAM TECNOL TE In CRIOSoft configuration window we can easy configure the 64 available indirect addressing registers with addresses 0x1000 0x103F We can also assign a textual comment to any virtual register This assignment table is stored in persistent memory so this needs to be done only once There are another 64 indirect addressing registers addresses 0x1100 0x113F which are stored in volatile memory which allow very easily indirect addressing that must change frequently in time Configuration Communications and program Persistent virtual registers Analog inputs scaling Virtual register Physical register Description CO OO OO co co co cc oO CH Page 30 SIAM CRIO v3 0 SIAM User Manual PS TECNOL TE 6 8 3 Analog inputs scaling In the last tab we can configure the scaling for the analog inputs For any input we must specify the Reogre minimum and maximum value for the scaling These values must be in the Communications and program range 32768 32767 The Persistent virtual registers Analog inputs scaling maximum value must be higher than the minimum Min value IM dg Max value 5 20m4 This scaling is very useful in order to work in the user program with engineering units instead of unscaled 0 1023 values For ex
33. egister where the virtual registers 0x1100 0x111F are mapped They are stored in volatile memory so they loose their contents after power down on power up all virtual registers 0x1000 0x111F point to physical register 0x0000 8 2 2 Configuration registers 0x7003 0x700F Register Description 0x7000 Device identifier For this model its value is always 7001 0x1B59 0x7001 Hardware version 0x7002 Firmware verions Device identifier string These registers contain the ASCII characters that idendity the device in the modbus network for the SiAM CRIOSoft software 0x7010 0x7019 Reserved 0x701A 0x7023 Lower limit of scaling for analog inputs AIO AI7 read write See section 6 8 3 0x7024 0x702D Highet limit of scaling for analog inputs AIO AI7 read write See section 6 8 3 0x702E Modbus link timeout in milliseconds read write See section 6 8 1 Page 63 SLAM CRIO v3 0 User Manual 8 3 Modbus functions The SiAM CRIO borrad supports the modbus RTU protocol functions described in the following sections As frames are limited to 256 bytes is not possible to read or write more than a hundred modbus registers in a single transaction In all examples the slave address is 128 0x80 8 3 1 Read Holding Registers 0x03 This function code is used to read the contents of a contiguous block of holding registers The following example reads
34. er Description SW92 SW93 Modbus diagnostic counter for frames sent by slave read only This is a 32 bit counter SW90 high word SW91 low word Can be reset by setting bit S71 1 SW100 Diagnostic LED error code read only Value Description 0 CPU in STOP mode no errors 1 CPU in RUN mode no errors nor warnings 2 CPU in RUN mode with warnings 3 CPU in STOP mode with error SW110 Time flags status register read only This register is equal to SW2 but runs asynchronously to the main scan cycle SW111 Time command register read write Bit Description S111 0 Reset running time counters S111 1 Reserved S111 2 Not used S111 15 Not used SW112 Running time counter that increments every 100 milliseconds from 0 to 9 read only Can be reset by setting S111 0 SW113 Running time counter that increments every second from 0 to 59 read only Can be reset by setting S111 0 SW114 Running time counter that increments every minute from 0 to 59 read only Can be reset by setting S111 0 SW115 Running time counter that increments every hour from 0 to 23 read only Can be reset by setting S111 0 SW116 Running time counter that increments every day read only Can be reset by setting S111 0 SW120 SW127 Reserved SW130 SW137 Lower limit of scaling for analog inputs AI0 AI7 read write See section 6 8 3 SW140 SW147 Highet limit of scaling for analog inputs AIO AI7 read write See se
35. ers related to communications and the user program e Device ID This string up to 26 characters textually identifies the modbus slave when scanning the network by means of the Only connected devices in the New Project option e Modbus slave address This eem value is set via the dip switch bank as described in section 5 1 Persistent virtual registers Analog inputs scaling Communications and program e Communication baud rate This value is set via the dip switch Devcon bank as described in section 5 2 Modbus slave address 1 247 e Delay before modbus reply Communication baud rate bps This time in milliseconds Delay before modbus reply ms indicates the waiting time befote replying modbus requests from the master If the master needs a long time to switch transmission direction for example in the case of a PC with a RS232 485 converter with software flow control specially at low speeds 4800bps or lower it may be necessary to increase this time S Modbus link timeout ms Program watchdog time ms e Modbus link timeout If this time is exceeded without receiving modbus requests then the board will consider that the communications link is lost The state of the communication link is mapped to system bit S70 0 The user program can use this bit to react in case of loss of communication with the bus master e Program watchdog time This is the maximum allowed time for the execution of the complete
36. esssessasereisteie sissies NEESS REENEN ERENNERT aerate 44 RE NEE 44 744 EEPROM rette tis weed ENEE EEGENEN 44 7 4 5 S St em MOMONY EE 45 7 5 Program errors and warnings EE 51 7 6 Programming examples EE 53 7 6 1 Simple automatic doOh 20 01 ard aise neni nies 53 Page 2 SLAM CRIO v3 0 User Manual 7 6 2 Automatic door with local and remote control cccccccsseesesscseseeseeeseeseeseesaeenens 54 R G 55 7 6 4 NECHMITONCIOS ii siones ee esa EE awe newman 56 7 6 5 EEPROM checksum management 58 7 6 6 Use of indirect addressing regtsters E 60 8 MODBUS COMMUNI CAT ON ek KKK KKK ER ENKEN EN EK K KEREN RER ER KKK ek ee een OL GL Modb s Protocol iaa a a a EES NEE nee 61 8 2 Modbus moppinmg un 62 8 2 1 Indirect addressing registers AAA 63 8 2 2 Confiourationreogisters EE 63 8 3 Modbus FUNCTIONS cccccceccseesseecseecueecueeeueeueeecuseaussaueeauesauenauenauenausnauenaesauesauesaensaeesaeesagees 64 8 3 1 Read Holding Registers 0X03 Nk 64 8 3 2 Read Input Registers OXO4 cere neers sense saan eee saan eeeeaaaaeensaas 64 8 3 3 Write Single Register Oe ANNER 65 8 3 4 Write Multple Registers Oxil0 Nk 65 8 3 5 Mask Write Register OX16 ANNER ENNER ENNEN 66 8 3 6 Read Write Multiple Registers ONL7 uk 67 9 FREQUENTLY ASKED QUESTIONS cccscsncncncccenenseneneueuscneneuecnensuaecensesesesessssss OO 9 1 Communication with the board can not be estab
37. f the board This is a read write register so the user program can overwrite its value to programmatically change the modbus address The bus address switch bank is not read continuously but only on start up So after changing the modbus address of the board in the switch bank it must be restarted by removing and reapplying power or by toggling switch S8 in the upper switch bank as described below Page 19 SIAM CRIO v3 0 SIAM User Manual TECNOLSGic 5 2 Baud rate Communication baud rate is selected with switches 1 2 3 from the upper DIP switch bank shown in the picture on the left eeng ge The following baud rates can be selected f 3 3 s 1 1 U 1 S2 secco er omg S1 S2 KE Baud rate L S 3 seeeo OFF OFF OFF 4800 bps eremm 4800 SS eu ue OFF OFF ON 9600 bps 9600 19200 _ _ r 28800 _ 38400 7600 L sseg 128000 _ S6 PuLL OOWN OFF ON OFF 19200 bps ale Aen OFF ON ON 28800 bps ON OFF OFF 38400 bps ON OFF ON _ 57600 bps ON ON OFF 115200 bps ON ON ON 128000 bps As in the previous case the baud rate selececion is not read continuously but only on start up So a restart of the board is required after JK A E changing this setting mmm 7 op oF 10 11 e 4 mem 5 3 User defined switch Switch 4 in the upper switch bank has no predefined use It is mapped on star
38. gram END END PROGRAM The bit EEPROM_RESTORED MO 0 in this example will be activated to alert set an alarm in a higher level system that will tell the operator that memory has been corrupted and default values have been restored The operator should check if the values are correct or must be changed Page 58 SLAM CRIO v3 0 User Manual In some cases the main program should not begin executing until correct parameters have been manually set by the operator This could be accomplished in this way VAR_GLOBAL System bits EEPROM ERROR AT S0 7 BOOL EEPROM RESTORED AT MO 0 BOOL END_VAR PROGRAM Main LDN EEPROM ERROR OR EEPROM RESTORED J MPC MAIN PROG END MAIN PROG LD TRUE Start of main program END END PROGRAM This program would keep waiting for the modbus master to restore the correct parameters After that the master should activate the EEPROM_RESTORED MO0 0 bit and then the main program will begin execution Page 59 SLAM CRIO v3 0 S IAM User Manual a E 7 6 6 Use of indirect addressing registers The following program copies the first 50 registers from M memory to V memory using indirect addressing registers and the LOOP instruction VAR_GLOBAL POI NTER_M AT SW40 WORD POINTER v AT SW45 WORD I ND_M AT SW50 WORD ND v AT SW55 WORD END_VAR PROGRAM Main ACC 0 Set pointer to MWO Set pointer to VWO AC
39. he settings here have to oye Virtual registers match those configured with the configuration switches in Q Serge the board explained in the previous section address and S ed E baud rate The serial format for communications must be 8 data bits 1 stop bit and no parity Communications settings all Communications settings Connection Modbus Connection Modbus Serial port OTCPHIP Modbus slave address COM port comi Maximum number of retries Baud rate bps 9600 Silence time before tx ms Byte size bits 8 Parity Mo parity _ Swap bytes Stop bits One Timeout ms 500 RTS control Enabled E A ls www modbus org 6 1 Online mode Monitoring of signals inputs outputs registers etc is only possible in online mode To enter online mode select Monitor in Device menu or click the button s Page 23 SLAM CRIO v3 0 SIAM User Manual TECNOU al 6 2 Inputs and outputs The first option displays this window which displays the status of inputs and outputs in online mode Wi Inputs and outputs i V For any of the analog inputs you Digital inputs I0 0 210 15 Digital outputs 00 0 00 11 can see 00 01 02 03 04 05 06 07 08 09 10 11 12131415 0001 02 03 04 05 06 07 08 09 10 11 The scaled Value Unscaled Reading 0 1023 Percentage value 0 100 Voltage and current value Analog inputs hu SWB A Value Reading W 0 5 1 0 20m
40. hed the user will be asked to switch to RUN mode again to execute the new program Compare This option indicates if the program in the PLC board and PC CRIOSoft IDE are the same Memory erase This options completely deletes the user program It can be done in STOP mode RUN Starts the execution of the user program In the bottom area of the CRIOSoft window will show up a message indicating if the program is successfully started or if any error has occurred STOP Stops the execution of the user program This can be necessary to download a new program or to erase program memory Stopping the program will also deactivate all the digital outputs Page 35 SIAM CRIO v3 0 User Manual 7 LEC PROGRAMMI NG 7 1 The instruction list IL languange The instruction list IL language is the most basic and simple of those defined by the standard IEC 1131 3 It s a low level textual language whose syntax is similar to assembler An IL program consists of a sequential list of instructions with an operator and with or without an operand Every instruction can optionally be preceded by a label followed by Comments can appear anywhere in the program delimited by y This is an example of an IL program ZS OPERATOR OPERAND Ss START LD 0 0 Start pushbutton AND 0 1 Enable ST Q0 0 Motor on END The result of the logic operations is stored in two special accu
41. holding register 0x0000 Request Response Field name Value Hex Field name Value Hex Slave address 0x80 Slave address 0x80 Function 0x03 Function 0x03 Starting address HI 0x00 Byte count 0x02 Starting address LO 0x00 Value of register 0x0000 HI 0x00 Number of registers HI 0x00 Value of register 0x0000 LO 0x00 Number of registers LO 0x01 Checksum HI 0x84 Checksum HI 0x9A Checksum LO 0x5A Checksum LO 0x1B 8 3 2 Read I nput Registers 0x04 Identical to the previous one In this example registers 0x0200 0x0201 are read Request Response Field name Value Hex Field name Value Hex Slave address 0x80 Slave address 0x80 Function 0x04 Function 0x04 Starting address HI 0x02 Byte count 0x04 Starting address LO 0x00 Value of register 0x0200 HI 0x45 Number of registers HI 0x00 Value of register 0x0200 LO 0x02 Number of registers LO 0x02 Value of register 0x0201 HI 0x00 Checksum HI 0x6E Value of register 0x0201 LO 0x00 Checksum LO 0x62 Checksum HI OxDE Checksum LO 0x40 The read value of register 0x0200 is 0x4502 and the value of register 0x0201 is 0x0000 Page 64 SLAM CRIO v3 0 User Manual SIAM TECNOL TE 8 3 3 Write Single Register 0x06 This function allows writing of a single holding register This example writes the value OxF
42. ick over a register to change the value of its associated physical register Besides we can also change the assignment to real registers by cliking on the option Change physical register This table can be very useful to efficiently monitor program variables located in scattered or non contiguous locations in the program or in different memory areas That s because all the virtual register area can be read very quickly in one time instead of the multiple modbus reads required to read different non contiguous memory areas See section 6 8 2 for more information about virtual registers These registers are persistent that is the association to physical registers is stored in flash memory so it s not lost on power down Page 26 SLAM CRIO v3 0 S IAM User Manual TECNOL TE 6 7 Status The status window shows important Fus Operating state information about the current status Of sogast Version Running time Program th e boa rd Hardware SW76 0 0 0 Milliseconds SW112 Size bytes 0 Firmware 4SW77 0 0 0 Seconds SW113 Start position 0x0000 ES ims Minutes SW114 Memory usage 0 H yele time ms Hours S w115 Checksum Ox0000 d Operati ng state RUN or STO P Actual sw 0 Days SW118 Date Hee e Maximum SW8 0 Time 00 00 e Program status OK or with error mer PC zo e H a rdwa re a nd fi rmwa re ve Ti on of Status bits Modbus diagnostic counters Power SD A the boar
43. le Register 16 0x10 Write Multiple Registers 17 0x11 Report Slave ID 22 0x16 Mask Write Register 23 0x17 Read Write Multiple Registers 43 14 0x2B 0x0D Read Device Identification o Indirect addressing modbus registers for optimizing communication cycles External power supply 9 30VDC LED indication for the board power supply Free software for programming configuration and diagnostics Plug in screw connectors DIN rail mounting enclosure Size 144 mm x 90 mm x 31mm Page 4 SIAM CRIO v3 0 User Manual 2 INTRODUCTION SIAM CRIO is a programmable remote input output controller with integrated modbus slave communication It can be used as a remote I O module in a fieldbus controlled by any device that implements the modbus master protocol such as computers PCs programmable controllers PLCs operator panels HMIs etc This fieldbus topology has great advantages over centralised control systems because allows the distribution of I O modules reducing the length of the wiring for sensors and actuators and reducing also the size of the electric cabinets Besides the central controller PC or PLC can be placed anywhere in the plant in the control room for example This new version can also work as a stand alone programmable logic controller or PLC executing small control tasks that can be programmed in the instruction list IL language defined in the IEC 1131 3 international standard Both operating modes
44. lished cccccccsccsssessseesseeeeseeeesaes 68 9 2 Digital outputs are alll Inachive AAA 68 9 3 The IEC code is not executing correchhy EN 69 10 ELECTRICAL CHARACTERISTICS sccccscsecneneuceceneneuecneneuaenenenseneneueunenenennenes 70 Page 3 SLAM CRIO v3 0 SIAM User Manual Pen TECNOL TE 1 CHARACTERISTICS E 19 00 lt e Programmable controller with integrated inputs outputs o Programmable in instruction list IL language according to IEC 1131 3 standard o 8192 program bytes 1300 8000 IEC instructions o 512 user words 256 retentive 256 non retentive o Supports the following IEC data types BOOL BYTE SINT WORD INT DWORD DINT REAL Inputs ouputs o 16 optoisolated 12 24VDC digital inputs o 12 optoisolated 12 24VDC digital outputs o Up to eight 0 5V or 0 20mA analog inputs 10 bit resolution o Indepentent supply for digital outputs Communications o RS 485 up to 64 devices in the bus or RS 232 serial communication o Operation at 8 different speeds 4800 bps 9600 bps 19200 bps 28800 bps 38400 bps 57600 bps 115200 bps 128000 bps o Bus termination resistor to avoid reflections and pull up and pull down resistors to stabilize bus jumper selectable o LED indication for state of reception and transmisssion o Modbus RTU slave protocol The following commands are supported 03 0x03 Read Holding Registers 04 0x04 Read Input Registers 06 0x06 Write Sing
45. ly see section 7 5 SW13 Program counter for instruction with error read only SW14 Counter of number of nested calls read only SW15 SW16 SW19 Counter of number of nested parentheses read only Reserved SW20 Inputs force OFF mask read write When I O forces are active S1 7 every active bit in this register will cause the corresponding input to be forced OFF irrespectively of the voltage in the physical input connector SW21 Inputs force ON mask read write When I O forces are active S1 7 every active bit in this register will cause the corresponding input to be forced ON irrespectively of the voltage in the physical input connector SW22 Outputs force OFF mask read write When I O forces are active S1 7 every active bit in this register will cause the corresponding output to be forced OFF irrespectively of the result of the user program for that output SW23 Outputs force ON mask read write When I O forces are active S1 7 every active bit in this register will cause the corresponding output to be forced ON irrespectively of the result of the user program for that output SW30 SW37 Unscaled analog input AIO AI7 read only WORD type value with range 0 1023 Page 47 SLAM CRIO v3 0 User Manual Register Description SW4O0 SW44 Indirect addressing pointers to M memory area read write The
46. moving and reapplying power to the whole board The microcontroller is continuously reset while this switch is OFF This can be very useful to quickly update the configuration of the board modbus address baud rate after any change in the configuration switches Page 21 SIAM CRIO v3 0 SIAM User Manual a TECNOL TE 6 SOFTWARE The software utility for configuration and programming of the SiAMCRIO board is CRIOSoft which can be freely downloaded from SiAM web From CRIOSoft open a new project and select device SiAM CRI O v3 0 PE00007 New project Project name All supported devices Only connected devices Description Code Package version Help Kl Generic Modbus Slave GenericModbusSlave bpl 4 1 0 6 K SIAM CRIO 3 0 PE00007 PEOOOOZ bei 4 1 0 53 Sa Communications settings If the board is connected to the modbus network and the serial port is correctly configured select Only connected devices to scan the bus If the board is found double click it to open a new project Page 22 SIAM CRIO v3 0 S IAM User Manual Hi AS The main device options will show up in the right panel of g SIAM CRIO 3 0 the CRIOSoft window as well as some buttons in the top J outputs toolbar and some menus with even more options M RAM memory M u EEPROM memory D I The first thing to do is to set up the Communication System memory 5 settings in the Tools menu T
47. mulators e RLO result of logic operation for logic operations 1 bit size e ACC accumulato for arithmetic operations up to 32 bit size The IL operators are overloaded that is the same operator can operate on several types of operands and do different things So for example LD I0 0 would load the RLO with the value of the input I0 0 On the other hand LD IWO would load the ACC with the value of the first inputs word leaving RLO unchanged The ACC type is not fixed but variable over time Any load operation will set the ACC type to the variable being loaded and any subsequent operation on the ACC can change its type See this example LD 1 ACC type is INT LD 1 0 ACC type is REAL LD 1 ACC type is INT ADD 1 0 Operand is REAL so ACC is converted to REAL Page 36 SLAM CRIO v3 0 User Manual 7 2 Data types The supported IEC data types are the following IEC type Description Size in bits Allowed values BOOL Bit 1 TRUE FALSE BYTE Unsigned byte 8 0 255 SINT Signed byte 8 128 127 WORD Unsigned word 16 0 65535 INT Signed word 16 32768 32767 DWORD Unsigned double word 32 0 4294967295 DINT Signed double word 32 2147483648 2147483647 REAL Floating point value IEEE 754 32 7 3 Instructions The next table summarizes all the supported instructions For each instruction it s shown which
48. nd deactivates it for 5 seconds VAR GLOBAL OUTO AT Q0 0 BOOL PULSE 1S AT 52 3 BOOL COUNT AT MWO WORD END_VAR PROGRAM Main 1S Check 1 second pulse _ Ee Lesben zZ SS E nu ao SE a GMF orc cor 2z mv rm KA Increment counter LABEL1 TRUE COUNT Check counter LABEL2 COUNT Reset if greater than 15 1045 seconds TRUE COUNT CH LABEL OUTO Activate output if counter lt 10 seconds END PROGRAM Page 57 SLAM CRIO v3 0 S IAM User Manual TECNOL TE 7 6 5 EEPROM checksum management The following example would restore default values for the variables in the event of a checksum error on program startup VAR_GLOBAL System bits FIRST CYCLE AT S0 2 BOOL EEPROM ERROR AT S0 7 BOOL EEPROM WRITE AT S1 8 BOOL EEPROM RESTORED AT M0 0 BOOL Variables in V memory VARI INT VAR2 INT VAR3 INT END_VAR PROGRAM Main LD FIRST CYCLE Check first PLC scan AND EEPROM ERROR Ir EEPROM checksum error J MPC RESET EE then jump to restore values J MP MAIN _ PROG otherwise go to main program RESET EE LD 100 Default value for VARI ST VARI LD 200 Default value for VAR2 ST VAR2 LD 300 Default value for VAR3 ST VAR3 LD TRUE S EEPROM_WRITE Force dump of V memory to EEPROM S EEPROM_RESTORED Activate alarm MAIN PROG LD TRUE Start of main pro
49. ne program monitoring Se re he Ra a ee Page 33 SLAM CRIO v3 0 SIAM User Manual TECNOL TE For every program line with executable instructions we can see e Value of the operand e Value of the logical accumulator RLO e Value of the numeric accumulator ACC These displayed values are read just in the moment after the execution of the current instruction Page 34 SIAM CRIO v3 0 User Manual 6 10 Other device options In the Program menu and in the toolbar there are other important options for the programming of the SiAMCRIO board which are the following e Compile Compiles the IEC user program Any warnings or errors will be displayed in the bottom area of the CRIOSoft window and double clicking on them will highlight the code line were the problem was found It s necessary to compile the program before downloading it to the board Download Select this option to transfer and execute the compiled program to the SiIAMCRIO board Download is only possible in offline mode and the program must be correctly compiled If the size of the program is small and fits in the available memory together with the program in execution then the board will automatically switch to the new program just after download without the need to stop execution On the other hand if the compiled program size is big then it will be necessary to switch to STOP before download When the transfer is finis
50. ng code activates output Q0 0 when input I10 0 is active for 5 seconds VAR_GLOBAL NO AT 0 0 BOOL OUTO AT Q0 0 BOOL PULSE 15 AT S2 3 BOOL TIMER AT MWO WORD END_VAR PROGRAM Main LD INO J MPC COUNT CLR TIMER JMP CHECK COUNT LDN PULSE_1 J MPC CHECK INC TIMER CHECK LD TIMER GE 5 ST OUTO END END PROGRAM Check the input If it s 1 let s check the time flag If it s 0 reset the timer S Check the time flag If it s 0 don t increment the timer If it s 1 increment the timer EAT timer Ir Je greater than 5 seconds then we activate the output Page 55 7 6 4 Intermitencies SLAM CRIO v3 0 User Manual SIAM TECNOL TE There are many system bits which can be used for regular intermittencies as shown in this example PROGRAM Main LD GER ST Q0 LD 5 3 ST Q0 LD GER ST Q0 LD 5 4 ST Q0 LD GER ST Q0 LD 5 4 ST Q0 END PROGRAM Intermitence Intermi tence Intermi tence Intermi tence Intermi tence Intermi tence 10 Hz zl Ss Zi 1 60 Hz zl every 256ms 4 Hz approx every 512ms 2 Hz approx every 2048ms 0 5 Hz approx Page 56 SLAM CRIO v3 0 S IAM User Manual TECNOL TE If an irregular intermitente is needed then it s necessary to work with counters as shown in this example that activates an output for 10 seconds a
51. ode If it s not correct this bit is set and the PLC remains in STOP mode S0 9 EEPROM memory changed This bit indicates if there is any change in V memory pending to be written to EEPROM The V memory is periodically dumped to EEPROM but the user program can check this bit to force an instantaneous dump to ensure the persistence of critical data S0 10 RUN mode This bit is active when the user program is executing RUN mode and inactive in STOP mode S0 11 Reserved S0 12 Reserved S0 13 Not used S0 14 Not used S0 15 Not used SW1 General command register read write Bit Description S1 0 Reset faults S1 1 Reset microcontroller software reset S1 2 Reset maximum cycle time S1 3 Start program execution RUN mode request S1 4 Not used S1 5 Reserved S1 6 Reserved S1 7 Enable forcing of inputs and outputs see SW20 SW23 S1 8 Force V memory dump to EEPROM The dump will not take place immediately after settingo this bit but at the end of the PLC scan S1 8 Not used S1 9 Not used S1 10 Not used S1 11 Not used S1 12 Not used S1 13 Not used S1 14 Not used S1 15 Not used Page 45 SLAM CRIO v3 0 User Manual Register Description SW2 Time flags register read only Bit Description S2
52. oid this there is a system bit S1 8 that can be set by the user program to force an instantaneous dumping of the V memory to EEPROM and ensure critical data This dumping is done in a smart way to maximize EEPROM endurance by writing only registers that have been modified since the previous dump The integrity of the V memory is checked at start up and it s mapped to system bit S0 7 If this bit is active EEPROM memory can be corrupted and the data stored in V memory may not be valid anymore The user program should check this bit on start up and restore default values for the application if it s active or signal an alarm and wait for user intervention Jor example by externally downloading of parameters via modbus before starting the main program Page 43 SLAM CRIO v3 0 S IAM User Manual TECGNOLOGiIC ial 7 4 1 Inputs memory Register Description IWO Digital inputs register read write Digital input DIO Digital input DI1 2 Digital input DI2 15 Digital input DI15 Bit Description 1 If any input is configured as analog the corresponding bit will be active if the analog value is above 50 of the maximum analog level 5V 20mA and inactive otherwise IW1 IW8 Scaled analog input AIO AI7 read write SINT type value with range 32768 32767 7 4 2 Outputs memory Register Description QWO Digital outputs read write Bit Descripti
53. on Digital output DIO Digital output DI1 Digital output DI2 N Rlo 11 Digital output DI11 12 Not used 13 Not used 14 Not used 15 Not used 7 4 3 RAM memory Register Description MWO MW255 RAM user memory read write There registers are non persistent and will be lost when power is removed from the board 7 4 4 EEPROM memory Register Description VWO VW255 EEPROM user memory read write There registers are persistent and will not be lost even when power is removed from the board Page 44 SLAM CRIO v3 0 S IAM User Manual TECNOL TE 7 4 5 System memory Register Description SWO General status register read only Bit Description S0 0 Bit always FALSE S0 1 Bit always TRUE S0 2 First cycle TRUE in the first PLC scan after switching from STOP to RUN and FALSE in all the others S0 3 Not used S0 4__ This bit indicates if last reset was a power on normal reset S0 5 This bit indicates if last reset was a brown out reset S0 6 This bit indicates if last reset was a watchdog reset S0 7 EEPROM checksum error The persistent memory is checked on start up and this bit is set if it s not correct The user program should check it to load default values for the important variables in the program S0 8 Program memory checksum error The program memory is checked when switching to RUN m
54. only if RLO equivalent to LD TRUE equivalent to LD FALSE structions is TRUE If used without operand sets RLO to TRUE unconditionally Sets operand to FALSE only if RLO is TRUE If used without operand sets RLO to FALSE unconditionally NOT 1 4 Performs bitwise inversion of the operand If used without operand inverts RLO AND 3 6 Bitwise logical AND operation between operand and RLO if boolean or ACC otherwise AND Logic AND between RLO and result of parenthesis ANDN 3 6 Bitwise logical AND operation between negated operand and RLO if boolean or ACC otherwise ANDN 1 negated result of parenthesis Logical AND between RLO and OR D 3 6 D e D e D e D D D Bitwise logical OR operation between operand and RLO if boolean or ACC otherwise OR D 1 Logical OR between RLO and result of parenthesis ORN D 3 6 o D D D D D e D D D Bitwise logical OR operation between negated operand and RLO if boolean or ACC otherwise 1 Can be used with or without operand 2 Nesting more than 4 parentheses or reaching the end of the program with any non closed parenthesis will cause a fatal error which will stop program execution Page 38 SLAM CRIO v3 0 User Manual Data types Memory areas Description Instruction Size bytes IEC Bool Byte Sint
55. ors in the modbus requests the SIAM CRIO board normally does not reply anything but in certain cases it can reply with exception responses The board supports broadcast frames with destination address 0 These requests will never have a response Page 61 SLAM CRIO v3 0 User Manual 8 2 Modbus mapping The SIAM CRIO board maps its inputs outputs and memory registers to externally accessible modbus registers according to the following mapping Modbus registers Description Access type 0x0000 0x00FF Input memory IWO IW255 Read only 0x0100 0x01FF Output memory QWO QW255 Read Write 0x0200 0x02FF System memory SWO SW255 Read Write 0x0300 0x03FF Reserved area Read Write 0x1000 0x1FFF Modbus indirect addressing registers Read Write 0x2000 0x2FFF Modbus indirect addressing configuration registers Read Write 0x4000 0x4FFF RAM user memory MWO MW255 Read Write 0x5000 0x5FFF EEPROM user memory VWO VW255 Read Write 0x6000 0x6FFF System memory SWO SW255 Read Write 0x7000 0x7FFF Configuration Read only 0x8000 0xFFFF User program Read only Only some of the 65536 available registers are used The others are read only registers that always return the value 0 The configuration 0x7000 0x7FFF and user program 0x8000 0xFFFF memory areas are read only areas The configuration software SIAM CRIOSoft can also write data to these areas System memo
56. ote control by a modbus master like a PLC o SCADA software The selection between local and remote mode is done with a two position selector connected to another input VAR_GLOBAL lepure PB_RAISE AT 0 0 BOOL Raise pushbutton PB LOWER AT 0 1 BOOL Lower pushbutton SWITCH UP AT 0 2 BOOL Limit switch up SWITCH DOWN AT 0 3 BOOL Limit switch down LOCAL AT 0 4 BOOL Local Remote control selector Remote commands REMOTE RAISE AT 0 0 BOOL Remote raise command REMOTE LOWER AT 0 1 BOOL Remote lower command Outputs RAISE AT Q0 0 BOOL Raise command LOWER AT Q0 1 BOOL Lower command END_VAR PROGRAM Main LD LOCAL AND PB RAISE OR LDN LOCAL AND REMOTE_RAISE ANDN SWITCH UP ST RAISE LD LOCAL AND PB LOWER OR LDN LOCAL AND REMOTE LOWER ANDN SWI TCH_DOWN ANDN RAISE ST LOWER END END PROGRAM Instead of the local remote selector we could use the link error bit S70 0 in such a way that if communications are active link error OFF the control would be remote but if communication is lost link error ON the program would automatically switch to local control Page 54 SIAM TECNOL TE 7 6 3 Timers SLAM CRIO v3 0 User Manual There are no instructions for direct manipulation of timers but these are very easy to program by using the time flag bits found in SW2 For example the followi
57. ry is mapped to two different register areas 0x0200 0x02FF and 0x6000 Ox6FFFF Input output system RAM and EEPROM memory areas have been described in detail in section 7 4 Indirect addressing areas described also previously in section 6 8 2 and configuration area are described in the following points Page 62 SIAM CRIO v3 0 S IAM User Manual TECNOL TE 8 2 1 Indirect addressing registers Register Description 0x1000 0x103F Persistent indirect addressing registers These virtual registers are redirected to the physical registers specified in 0x2000 0x201F as explained previously So if the register 0x2004 contains the value 10 accessing register 0x1004 will be the same that accessing register 10 0x000A 0x1100 0x113F Volatile indirect addressing registers These virtual registers are redirected to the physical registers specified in 0x2100 0x211F as explained previously So if the register 0x2104 contains the value 10 accessing register 0x1104 will be the same that accessing register 10 0x000A 0x2000 0x203F Persistent indirect addressing configuration registers These registers contain the number of register where the virtual registers 0x1000 0x101F are mapped They are stored in non volatile memory so they keep their contents after power down 0x2100 0x213F Volatile indirect addressing configuration registers These registers contain the number of r
58. s 4 IEC instruction execution time 75 150 us 10 No outputs active 1 All outputs active 12 Depends on type of instruction and can increase if program online monitoring is active Page 70 SLAM CRIO v3 0 User Manual 11 COPYRI GHT This product with all its components and this manual are property of Software i Automatismes Morvedre S L Total or partial reproduction of design program electronic board or manual is forbidden Any action against this statement will be prosecuted according to intellectual property laws April 2009 Page 71 SIAM TeCNOL SS Software i Automatismes Morvedre S L Vent de Ponent 22 46520 Puerto de Sagunto Valencia Spain www siam es info siam es
59. se pointers allow accessing M memory through virtual registers SW50 SW54 For example if we store the value 10 in SW40 then when we access virtual register SW50 we are really working with real register MW 210 This is very useful for some operations like loops SW45 SW49 Indirect addressing pointers to V memory area read write These pointers allow accessing V memory through virtual registers SW55 SW59 For example if we store the value 10 in SW45 then when we access virtual register SW55 we are really working with real register VW10 This is very useful for some operations like loops SW50 SW54 Virtual registers for indirect addressing in M memory area read write SW55 SW59 Virtual registers for indirect addressing in V memory area read write SW60 Serial port status register read only Bit Description S60 0 RX Timeout S60 1 RX Buffer overrun S60 2 RX Framing error S60 3 RX Parity error S60 4 RX Buffer full S60 5 Not used S60 15 Not used SW61 Serial port command register read write Bit Description S61 0 Reset serial port errors in SW60 S61 1 Not used 561 15 Not used SW62 Serial port baud rate read write On startup this setting is read from dip switches see section 5 2 but can be overwritten by user program at any time The possibl
60. t up to system bit S6 11 all the upper switch bank is mapped to system register SW6 The IEC user program can check this bit for any user defined purpose or just ignore it As the rest of the switches it is only read on start up So a restart of the board is required after changing this switch Page 20 SIAM CRIO v3 0 S IAM User Manual TECNOLSGic 5 4 Communication resistors Switches 5 6 7 from the upper DIP switch bank shown in the picture on the left control the communication resistors for RS 485 bus Lana INPUTS be Jumper Description Comments f S5 Pull up Stabilizes the bus Must VS 3 1a 15 BI SEEER D pechen D2 SPEO resistor be active in only one L iatase 390 Q node in the RS 485 S4 user network s6 d kaar eris S6 Pull down Stabilizes the bus Must 7 eus TERM resistor be active in only one 390 Q node in the RS 485 network S7 Bus termination Prevents reflections in resistor 220 Q the bus Must be active only in the terminal nodes in the bus and inactive in the all the intermediate nodes Pesce t0 1 These switches are hardware switches so they can be toggled at any time not only in start up ourTeurTs All theses switches are useless in the RS 232 version of the board 5 5 Reset switch Switch 8 in the upper switch bank is used to perform a hardware reset of the board microcontroller without the need of re
61. termination is required at both ends of the bus Also line polarization can be necessary for some devices All these can be done with the configuration switches described in section 5 Page 10 SLAM CRIO v3 0 SIAM User Manual Pen TECNOL TE 4 2 2 RS 232 module This version uses a standard DB9 male connector which can be connected to a PC serial port with a normal null modem cable The pinout of this cable is shown in the following diagram DB9M SiAM CRIO DB9M PC Connecting DB9 shields is optional though recommended to increase noise immunity Connection to serial ports with DB25 connectors is also possible using standard DB25 DB9 adapters TX and RX LEDs will indicate the status of the communications just like in the RS 485 version Page 11 SLAM CRIO v3 0 S IAM User Manual D ee 4 3 Digital outputs The board has 12 optoisolated PNP Darlington digital outputs with independent supply for outputs 0 5 and outputs 6 11 The connection of the outputs is done in the following connectors DD Di O2 O3 Ga os os o7 os oe vo Se EK SKS E 000080 GL FE lk eee lk EEN SSS a a Ie E ege 7 ovTeuTre 7 gt cy SO Fe EE wm EE zm T TR fe rem pw we T gem mme Connector Description Comments 1 Power supply for digital Connect here the positive supply voltage for the first group of outputs DOO0 DO05 digital outputs This independent s
62. ture The rest of the connectors and LEDs are the same in both versions Page 7 SIAM CRIO v3 0 SIAM User Manual 3 INSTALLATION The SiAM CRIO board as any electronic controller must be placed as far as possible from heat sources power lines and any source of electrical noise such as relays or AC motor drives The dimensions of the board are these 50mm 30mm 142 5mm The board enclosure is equipped with two DIN rail mounting clips which make installation very easy To remove the board from the DIN rail pull with a flat screwdriver to release the clips Page 8 4 WIRING SLAM CRIO v3 0 SIA M User Manual TECNOLOGICI 4 1 Main power supply Power supply voltage supplies power to the electronic devices in the board It can be any voltage between 9 and 30 VDC and is connected through the connector shown in the following figure J POWER e STATUS OV Supply ground S Status I Earth The Status LED following table Connector Description Power V Supply voltage 9 30 VDC The Power LED will turn on to indicate that the board is powered If the board is powered but this led is not lit then there is a hardware problem and the board must be repaired indicates the current operating state of the device according to the Blink type Device status 1 second on STOP mode Program is empty or stopped by the user 1 second off
63. upply can be interrupted 9VDC 30VDC with an emergency stop or a safety relay for example to deactivate this group of outputs without affecting the others 2 Power supply for digital This is the power supply ground for the first group of digital outputs DO00 DO05 GND outputs It s internally connected to the main power supply round 3 Connectors for digital outputs Connect here digital outputs DO00 D005 When the DOO00 DO05 corresponding output is active its LED will be on and its terminal will have the voltage supplied in connector 1 9 30VDC typically 24VDC Otherwise voltage in the terminal will be OVDC and its LED will be off 4 Power supply for digital Connect here the positive supply voltage for the second group outputs DO06 DO11 of digital outputs This independent supply can be interrupted 9VDC 30VDC with an emergency stop or a safety relay for example to deactivate this group of outputs without affecting the others 5 Power supply for digital This is the power supply ground for the second group of digital outputs DO06 DO11 GND outputs It s internally connected to the main power supply ground 6 Connectors for digital outputs Connect here digital outputs DO06 D011 When the DO06 DO11 corresponding output is active its LED will be on and its terminal will have the voltage supplied in connector 4 9 30VDC typically 24VDC Otherwise voltage in the terminal will be OVDC and its L
64. used to modify the contents of a specified holding register using a combination of an AND mask an OR mask and the register s current contents The function can be used to set or clear individual bits in the register in this way Result Current Contents AND AND MASK OR OR_MASK AND NOT AND_ MASK So if the OR_MASK value is zero the result is simply the logical AND of the current contents and AND_MASK If the AND_MASK value is zero the result is equal to the OR_MASK value This example activates bits 5 and 6 in register 0x0300 Request Response Field name Value Hex Field name Value Hex Slave address 0x80 Slave address 0x80 Function 0x16 Function 0x16 Register address HI 0x03 Register address HI 0x03 Register address LO 0x00 Register address LO 0x00 AND mask HI 0x00 AND mask HI 0x00 AND mask LO 0x00 AND mask LO 0x00 OR mask HI 0x00 OR mask HI 0x00 OR mask LO 0x60 OR mask LO 0x60 Checksum HI 0x3F Checksum HI 0x3F Checksum LO OxB1 Checksum LO OxB1 Page 66 SLAM CRIO v3 0 User Manual 8 3 6 Read Write Multiple Registers 0x17 This function code performs a combination of one read operation and one write operation in a single modbus transaction The write operation is performed before the read It s very useful to read inputs and write outputs very quickly as shown in this example
65. user program Exceeding this time causes a fatal error that will stop program execution and turn off all digital outputs Page 28 SIAM CRIO v3 0 User Manual 6 8 2 Persistent virtual registers In the second tab we can configure the modbus indirect addressing which is of great use to optimize communication cycle time Indirect addressing consists of reading or writing a real or physical modbus register through an indirect or virtual register This allow the contiguous reading hat is with only one modbus transaction of non contiguous registers scattered across the memory map which otherwise could only be read with several transactions in a much slower way Let s see it with an example with the following mapping o Physical register 0x0000 gt Virtual register 0x1000 o Physical register 0x0100 gt Virtual register 0x1001 o Physical register 0x0200 gt Virtual register 0x1002 To read physical registers 0x000 0x0100 and 0x0200 normally we should need 3 modbus transactions request and reply But we can also read them by reading the 3 contiguous registers 0x1000 0x1001 and 0x1002 with only one modbus transaction for examply by using the frame READ HOLDING_REGISTERS code 0x03 We can read and write registers these 3 registers but we will really be working with the real associated registers So writing a value to register 0x1002 will really set the value of register 0x0200 This mapping or association between r
66. when RLO is FALSE and returns to instruction after CAL END e 1 End of user program Its use is compulsory Miscellaneous instructions NOP 1 No operation RTRIG 1 4 o e o Detects rising edge in RLO and stores previous result in operand FTRIG 1 4 o e o Detects falling edge in RLO and stores previous result in operand Accumulator instructions SWAP 1 Swap bytes in ACC ABS 1 Absolute value of ACC SQRT 1 Square root of ACC LN 1 Natural logarithm of ACC LOG 1 Base 10 logarithm of ACC EXP 1 Exponential of ACC SIN 1 Sine of ACC COS 1 Cosine of ACC TAN 1 Tangent of ACC ASIN 1 Arc sine of ACC ACOS 1 Arc cosine of ACC ATAN 1 Arc tangent of ACC If it s called outside a subroutine fatal error will stop program execution Page 41 SIAM CRIO v3 0 User Manual Data types Memory areas em 5 g t S Description 5 z z 2 ci QiM v s UO NI 0 2 eS a T ui gll E lg Conversion instructions TO_BYTE 1 Converts ACC to BYTE TO_SINT 1 Converts ACC to SINT TO_WORD 1 Converts ACC to WORD TO_INT 1 Converts ACC to INT TO_DWORD 1 Converts ACC to DWORD TO_DINT 1 Converts ACC to DINT TO_REAL 1 Converts ACC to REAL BCD 1 Converts ACC from decimal to BCD I_BCD 1 Converts ACC from BCD to decimal
Download Pdf Manuals
Related Search
Related Contents
Trust 20053 Philips HP8183 Hi-Q DC controller説明書 - Hi SL3000 Guide Manuale dell`utente van den hul総合カタログ MAudio PC program Manual de montaje - GardenSite.co.uk Sony HVL-RLA Camera Flash User Manual Préprogramme Copyright © All rights reserved.
Failed to retrieve file