Home

Reference manual (PDF file, english, ~650 Kib)

image

Contents

1. tO to fill variable EZRD_ISUP8 EZRD_READENCODER Pointer for flags and pointer for variable to fill with encoder position 0 0K or error code lt gt 0 Reads encoder position and flags EZRD_PRESETENCODER New value to set the encoder position to 0 0K or error code lt gt 0 Change the current position PRESET of the encoder EZRD_SETWATCHDOG Time out ms outputs pattern values for the two analog outputs 0 0K or error code lt gt 0 Configures enables or disables the internal EZ Red watch dog Page 8 12 www xonelectronics it K XON Electronics EZ Red User manual Functions details The following paragraphs explain in detail the single functions The used syntax is Pascal or Delphi Every function which returns a result those having a closed parenthesis followed by a colon return 0 zero for success and non zero for failure Most of the parameters are unsigned 32 bit integers When the parameters are be passed by reference and not by value is because the function modifies them Passing by reference is denoted with the word VAR in pascal with the symbol amp ampersand in C and with the word BYREF in basic The C syntax 1s sometimes called passing a pointer A pascal example like this if EZRD READ I0S inputs lt gt 0 then writeln Communication error is written like this in C if ezrd read i1os amp inputs printf Communicati
2. because there are only two analog outputs The arguments DA1 and DA2 contain the intended value from 0 to 255 used only if enabled by the bits in AN2 For example in C to read inputs without modifying any outputs ings 0 an2 0 no outputs will be affected res ezrd int 1os amp ings S amp outs amp dal amp da2 amp anl amp an2 The following updates only the analog output 1 dal 128 about 5 volts ings 0 an2 1 only bitO of an2 set to 1 to update only analog output 1 res ezrd int 1os amp ings Souts amp dal amp da2 amp anl amp an2 The following turns off all the power outputs and bring the analog outputs to 0 volts ings 255 all the bits set to 1 affect all the power outputs outs 0 all the bits set to 0 all the output off an2 3 bO amp b1 set to 1 update both analog outputs dal 0 da2 0 values for the two analog outputs res ezrd_ int_ios amp ings Souts amp dal amp da2 amp anl amp an2 After the function returns the variables are update to reflect the new states of input and outputs ings records the state of digital inputs bit by bit bO input 1 up to b7 input 8 outs records similarly the state of the digital power outputs dal contains the value from 0 to 255 of the DAC of the analog output 1 da2 contains the value from 0 to 255 of the DAC of the analog output 2 anl contains the value from 0 to 255 proportional to the voltage at analog input 1 an2 contains
3. NUL terminated string Optional to know model and firmware release of the device EZRD INT IOS See details 0 0K or error code lt gt 0 Most general function to read all inputs and set all outputs EZRD SET ALLOUTS Outputs pattern 0 0K or error code lt gt 0 Sets the 8 power outputs to a value EZRD SET ANA2 EZRD_SET IO Output 1 8 and status 0 or 1 0 0K or error code lt gt 0 Sets a single output EZRD UPI None 0 0K or error code lt gt 0 Turns on UP the specific power output AOs EZRD_UP8 EZRD DNI None 0 0K or error code lt gt 0 Turns off DN down the output atO EZRD DN8 EZRD SET ANAI A value from 0 to 255 0 0K or error code lt gt 0 Sets a voltage for the analog output and proportional to the argument 0 0 volts 255 10 volts EZRD READ AINI and EZRD READ AIN2 Pointer address to the variable to fill 0 0K or error code lt gt 0 Reads the analog input and writes a number from 0 to 255 in the specified variable EZRD READ IOS Pointer address to the variable to fill 0 0K or error code lt gt 0 Reads all the digital inputs and writes them to the specified variable EZRD_ISUP_ IO Input number 1 8 and pointer to 0 OK or error code lt gt 0 Reads a single digital input and fills the the variable to fill indicated variable EZRD_ISUP1 Pointer address to the variable 0 OK or error code lt gt 0 Reads the input and fills the indicated
4. cardinal Reads the voltage at analog input 1 writing in PARM a value from 0 to 255 proportional to the voltage 0 10 volts ezrd_read_ain2 var parm cardinal The same as before for analog input 2 ezrd_read_ios var onoff cardinal Reads all the digital inputs modifying the argument ONOFF with a bit set for every input that is ON has voltage on it ezrd isup io which1 8 cardinal var onoff cardinal This function reads a single digital input Differently from the previous one avoids to operate with bit masks The argument WHICH 1 8 must contain a number from 1 to 8 that specifies which input to read the argument ONOFF will contain 0 or 1 reflecting the state of the input A cardinal is an unsigned 32 bit integer www xonelectronics it Page 11 12 K XON Electronics EZ Red User manual ezrd_isup1 var onoff cardinal ezrd_isup8 var onoff cardinal These functions read the indicated input by the name of the function itself and fill the passed argument which is a 32 bit integer ezrd_readencoder var flags encoder cardinal Reads the encoder position if an encoder is connected to the fast inputs FX1 and FX2 and a set of flags related in general to the device Both the arguments are passed by reference for the function to fill them The returned flags are packed in a pattern the following table explains them Bit position and name Bit mask Description 1 WDTFIRED 2 ON when the internal
5. la pertenca da collegare o da nmuovere e quindi fare clic su associated the virtual port COM4 This 1S the port to Disathiva Attendere che venga visualizzato un messaggio di conferma Ay E Bs E Sati ete refer to when initiating a communication to the EZ Pentenche hardware Red eT ice Smia Por COMA The name of the port can be different than this one S USB Serial Converter B COM4 it depends on the operating system Using USE Serial Port COM17 I ad Neale the Control Panel of the o s it 1s possible partly to change the assigned name USB Seral Converter a Percorso O Proprieta Disattiva M Visualizza componenti delle periferiche Chiudi Driver installation In order to use the USB interface the correct FTDI drivers must be installed They can be downloaded from XON Electronics web site or directly from the FTDI web site www ftdichip com If these driver are not already present in the computer they will be asked for as soon as the EZ Red device is detected from the operating system Whatever is the case to install the drivers VCP type Virtual COM Port a file containing them must be downloaded and extracted to any directory Then it is possible to right click on the file FTDIPORT INF and select Install from the pop up menu or turn the EZ Red on and connect it to the computer to make the o s ask for the drivers then direct the o s to the directory where the files where extracted Page 6 12 www xo
6. watch dog is fired in effect 3 CYCLERUN 4 Indicates whether the internal PLC is executing a cycle ON run 8 FXI 256 ON OFF state of the fast input FX1 9 FX2 512 ON OFF state of the fast input FX2 13 FLASHFAIL 8192 When the internal flash memory fails this bit goes high ezrd_SetWatchdog tmout ioconf aout1 aout2 cardinal Configures and enables disables the internal watch dog for the communication time out The argument TMOUT must contain a value from 0 to 65535 which indicates the number of milliseconds to wait between a USB packet command and the next one If this number is 0 there is no time out and the watch dog will not fire for a communication loss but it can fire for other reasons When TMOUT is non zero no USB packets can arrive more than TMOUT milliseconds after the previous one If TMOUT is 2000 for example the computer must send at least a command every 2 seconds otherwise the communication is considered broken When the watch dog fires it sets the outputs in the way IOCONF AOUT1 and AOUT2 specify IOCONF must contain a bit pattern for the power outputs a bit for every output bit0 power output 1 and so on The power on status of this pattern is 192 OxCO in hexadecimal which corresponds to outputs 1 6 off and output 7 and 8 on AOUT1 and AOUT2 specify respectively the analog voltages to set when the watch dog fires the power on value is 0 for both analog outputs Acceptable values range from 0 to 25
7. 5 corresponding to voltages from 0 to 10 volts XON ELECTRONICS SRL WWW XONELECTRONICS IT INFO xONELECTRONICS IT XON ELECTROANICS Internet product page is http www xonelectronics it prodotti industriali EZ Red Please report any error or imprecision to web xonelectronics it Page 12 12 www xonelectronics it
8. E E 7 MMOL SA e E E E E coat A E A A E E AE E E Gace I C E A E E O E E 7 a e E E A E E E A E A E 7 List of functions exported from the LDrary ccccccccccccccccececeeeeeeeeeeeeeseeesseeeeeeeeeeeeesaseeseeseseeseeseeaeees 8 Ponchon 6 oe 1k ae te ee nn Ne AE E eee eee 9 SAT OPC COG MI CI Yi gece egite E pcarsey eee ve E eh ecant E EE 9 FL OS ge seers carps ede este csv de ese ge bore E IT E E EEEN 9 Gare mode BC man Oi lai id G S E E E 9 ezrd_ int ios var ings outs dal da2 an1 an2 byte cceeeeeeeeeeeeeeeeceeeseaeeeeceeeeeas 9 C700 ser ARIOUIES patie cardina I sinc saerrrsa cans eratissscitonatue saapinesanea n e E S 11 ezrd set io which1 8 cardinal onoff cardinal nnnnnnnnnnnnnnssresesereereererererrrrrereresssssereessse 11 716 U0 0 et 74 E AN E E EE E E EE E AE E AE eee 11 A e SIN E E E E E EE E 11 czid Set Anal Marin Cardinal eesriie i a a r a a iii 11 ezrd set ana2 parm Cardinal ccccccccccccccccccccceeeeeeeceaaseessseeseeeeeeeeceeeeeeeeeeeeeeaaeessseseeeeeeeeeeeaaees 11 czad tead mni yar parin cardinal esc pace sare a E E 1 ey ACG Ma ops 6 Mees UNDA r OYA t ee ers KOU eae ne ee een eee ee Pee ee 11 eard read 10S Var ono Gadna eea E E 11 ezrd isup io which1 8 cardinal var onoff Cardimal ccccccccccccccccccccceeeeeceeeceeeeeeeeeeeeeeeeeeeeeeaas 11 ezrd_isupl var onoff cardinal ezrd_isup8 var onoff cardinal ccccceceeeeeeeeeeeeeeeeeeeeeeees 12 ezrd read
9. K XON Electronics EZ Red User manual EZ Red Power I O module for PC See http www xonelectronics it for other manuals Index PIERO CNC TIO i PNET EE 2 PO e D e E E T AAE A E E A 2 Da oe a 0 Li A tno E ae eee ences eee ae eee eee eee eee 3 FASE OP OC OMe Gre a MINIS cats cc cotton sees caceeceteodyetsacateeeeses sss edec eetoodyetsaccaeeneecenanss eeuemeces 3 PANN OS AUIS accede E E E sears same aoe E eee eee 3 LAN OW CP OUND UNS n E E E E E E E 4 ADO On WY eE E E EAE A E OAE E E AET 4 Auxiliary output power supply 12 Volt ccccccccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeesssaeeaseeeeessaeana ee 4 Process control and data acquisition With a PC cc ceessssssseeeeccccccceeeeeeeceesaueesssseeeeeeeceesuaeeeesanees 5 Using the supplied DLL or the terminal emulation mode text commands cccccceeeeeeeees 5 DA a y E ca tc ects csc ee ae es E ces ate ve vase esi E E aes season eee ee 5 Intemial Watch GOo INteOrsly control ziniacvetccaszantess crecteassuadeccaansdecaseneteds E E a S 5 Cono loys ere Dle een een nnn enn een ene met eee ee ne ae te ee eee ee terre 6 UB CCT acest erence de AAE AE A E AE EEA AAA E EE AA AAE EEA E 6 D a HANS CO hese eat E E AE E E A A EE A E EE 6 Ee TMT S ESAS eea e E E E EETA E EN E E AE E EE E AAE 7 External function declaration cccccccccccccccecceceeeeeeaaeeeeeeessseeeeeeeeeeeeeeeeeeeeeesaeaeeeeeeseeeeeeeeeeeeeeeeaaaaes fi O E seo coe are E OE eee eb cence pee E A A E E
10. S A I O E a aa BE S 5 FC1 EZ Red z Cc D Power module eee This example shows a few possible connections switches variable resistors electro valves relays and small DC motors Power supply The device must powered by DC voltage from 12 to 30 volts The current consumption for the EZ Red alone is 200 mA to this consumption must be added the ones drew by the external devices connected to the power outputs An auxiliary power supply V is generated internally Both external and internal generated power supplies are monitored by EZ Red The device can be powered with voltages lower than 15 volts but anyway higher than 10 volts in this case the analog outputs will not reach their full 10 volt peak and will lose linearity Power supply input Page 2 12 www xonelectronics it Ao XON Electronics EZ Red User manual Digital inputs 24 volts GND connections The eight digital inputs X1 X8 have an input impedance of 10 Kohm and a protecting circuitry that limits the maximum frequency of the input signals to about 1 Khz Two of these inputs X1 e X2 have an associated hardware counter which can count the rising edges of the input signal without CPU waste Digital inputs 1 2 3 4 Digital inputs 5 6 7 8 Fast opto coupled digital inputs The two inputs FX1 and FX2 F1 and F2 on the connector are opto coupled and have a hardware coun
11. encoder var flags encoder Cardinal ccccccccccccsssssssssssssseeeeeecceeeeeeeeeeeaeaesseeeseeeeeeeeas 12 ezrd SetWatchdog tmout ioconf aout aout2 cardinal ccccceeesssessessseececeeeeaaeeeeeeeeeeaas 12 www xonelectronics it Page 1 12 K XON Electronics EZ Red User manual Introduction EZ Red is a power interface module which connects through the USB interface to a computer in order to drive external electric devices at 24 volts The module features 8 digital inputs which accept voltage from 5 to 30 volts 8 digital power outputs at 24 volts 2A which can drive inductive loads output voltage is the same as power supply from 12 to 30 volts maximum output current of all the power outputs together is 4A 2 fast 10 Khz opto coupled inputs usable as is or suitable for a quadrature encoder 2 analog inputs 0 10V 2 analog outputs 0 10V 1 auxiliary stabilized output power supply at 12 volts 13 5 volts 200 mA Continuous monitoring on power outputs for overload and open circuit Continuous monitoring on power supply voltages Internal configurable watch dog to protect from computer hang ups Internal PLC which stores and executes autonomous cycles Flash non volatile memory to store PLC program and configuration data 10 Vdc 5 30 Volt I 2 9 g Y OT T OTN 5 o 9QO O 3 py a O o rT a a O O 19 F ok H 9 gt O O O o M1 g amp 90 O 5 s o O OQ o z
12. iary power supply generated internally by the EZ Red The voltage is stabilized at 13 4 volts with maximum output current of 200 mA and is protected by an auto resetting fuse All the GND are connected together Power supply output 12V 200mA Page 4 12 www xonelectronics it K XON Electronics EZ Red User manual Process control and data acquisition with a PC Using its USB interface it is possible to dialogate with EZ Red in order to read its inputs and set its output There are two possible ways to interact using the supplied windows library ezreddll dll or using a simple text based protocol in a terminal emulation mode like a modem The DLL is suitable for high level compiled languages including LabView and frees the application to deal with low level communication details the text commands mode console is more simple but still effective even if the application must implement a normal bi directional serial communication Using the supplied DLL or the terminal emulation mode text commands This manual describes the library EZRedDLL and its CUM4 36400 bps ONT no handshake usage For info about simple text commands please DK refer to the manual Terminal emulation text plampmask1 255 commands LF fy The terminal emulation mode is also suitable for using 1 0 il EZ Red under Linux Internal PLC The EZ Red module contains an internal PLC which can aid the computer in carryi
13. is function is the core to read and write all inputs and outputs of the device This function is rather complicated there are other more simple than this All the arguments to the function are 8 bit unsigned integer and must be passed BY REFERENCE not www xonelectronics it Page 9 12 K XON Electronics EZ Red User manual by value Prior to execute the invocation the arguments must be set up in the following way ings bit pattern mask to indicate the power outputs to operate on bit0O output 1 bit7 output 8 Bits that are let the output be changed bits that are 0 leave it as 1s outs bit pattern to indicate the new state of the output if the corresponding bit of ings is 1 A bit of outs is ignored 1f the corresponding bit of ings is 0 For example to modify only the power output 1 set ings 1 then set outs 1 to turn on or outs 0 to turn the output off The only bit set to 1 in INGS says that the only output that must be changed is the first corresponding to bitO The other bits in OUTS will be ignored so the corresponding outputs will remain untouched To operate on all output together use INGS 255 and the desired pattern one bit for every output in OUTS to turn all outputs on OUTS 255 to turn all outputs off OUTS 0 To operate on the analog outputs 1 amp 2 follow the same principle the argument AN2 must contain a bit set to 1 for an analog output to be updated only the first two bits count
14. nelectronics it K XON Electronics EZ Red User manual ezredadll dil library usage Place a copy of the library in the same directory where the application resides or a common path of the operating system for example C WINDOWS but this is o s dependent Then declare inside your application the exported functions of ezreddll explained next in this document Only the needed functions have to be declared it is possible to use the EZ Red by declaring only two external functions All the exported functions have a lowercase name they are written in uppercase in this manual for greater evidence but in the real library their name is lowercase Most of the function results are 32 bits signed integers EZRD CLOSE does not return a result and EZRD MODEL returns a C string a string terminated by a NUL character which is normal in Windows The arguments of the functions vary all the functions use the stdcall model which is the standard model even if not the only one in Windows An application must invoke EZRD OPEN prior to any other library invocation pass to this function EZRD OPEN the port number as seen before The function returns 0 zero in case of success or a non zero number otherwise for example if the specified port does not exists or is already is use External function declaration Some declaration example for different languages is shown here for reference C public class ExternalEZRD DLLImpo
15. ng out strict time duties or use the EZ Red in stand alone mode without a computer In order to utilize the PLC a program PLC cycle must be written and stored in the non volatile memory of the module To learn more about the programming language and how to write a PLC cycle please refer to the manual Programming manual The program must then be compiled and transferred to the EZ Red using the supplied utility TSMon exe which is a true programming environment See the TSMon user manual The stored PLC program can be protected with a password by the way it is not possible to read the internal PLC memory anyway and additionally a PLC program can set a bit which inhibits the USB communication This bit can be reset by the PC 1f the correct password is known Internal watch dog integrity control When the EZ Red is employed together with a PC in a process control it can be desirable that if the computer stops to work the process is brought in a secure state a state where the outputs are set in a known and safe configuration The watch dog if enabled monitors the communication with the computer to ensure that the computer and the communication with it is working if for some time too much time the communication ceases the system is assumed to be unsafe because not responsive the watch dog fires and sets the outputs to a determined pattern The time out acceptable delay in communication is configurable as is the time ou
16. on error and like this in basic VB If ezrd read ios inputs lt gt 0 Then Print Communication error ezrd_open comport integer It is used to initialize the library and the communication with EZ Red The USB interface creates two virtual COM ports the one to use is labelled A see which number is assigned to port A This function must be called once before access is allowed to the others The library opens the indicated port and queries the device If all the handshake phases succeed the result is zero If it is impossible to open the port because busy non existent a Windows error code is returned If the port can be opened but no EZ Red is found the error code 8 is returned ezrd close Closes the communication freeing the port There is no returned result and it is not an error to close the communication even if none had been opened before After the call to this function all the other functions will return an error because the communication 1s no more valid ezrd_ model PChar or char in C This function does not return an integer but a pointer a C nul terminated string The string itself contains in text mode name and release of the device and its firmware like EZ RED 1 2 The returned pointer must be considered read only it can be NULL and it can point to a NUL byte in both cases this means that an error has happened ezrd_int_tos var ings outs da1 da2 an1 an2 byte Th
17. rt ezreddll dll public static extern int ezrd open int comport DllImport ezreddll dll public static extern void ezrd close DllImport ezreddll dll public static extern int ezrd int ios ref byte ings ref byte outs ref byte dal ref byte da2 ref byte an1 ref byte an2 Delphi pascal mydll ezreddll dll function ezrd open comport integer integer stdcall external mydll procedure ezrd close stdcall external mydll function ezrd int ios var ings outs dal da2 anl an2 byte integer stdcall external mydll C extern C declspec dllimport stdcall long zrd open int COMDOLL 7 void ezrd close long ezrd int ios unsigned char ings outs dal da2 anl an2 Visual basic Declare Function ezrd open Lib ezreddll dll comport as long As Long Declare Sub ezrd close Lib ezreddll dll Declare Sub ezrd int ios Lib ezreddll dll ByVal ings as byte ByVal outs as Byte _ ByVal dal as Byte ByVal da2 as Byte ByVal anl as Byte ByVal an2 as Byte as Long www xonelectronics it Page 7 12 K XON Electronics EZ Red User manual List of functions exported from the library Function name Input parameters Result Description C style string EZRD OPEN COM number to use like 3 for Integer 0 means OK Call this before any other function COM3 otherwise an error code EZRD CLOSE None None Optional close communication with EZ Red EZRD MODEL None
18. t Another effect the watch dog can be programmed to have is to stop the running PLC cycle The watch dog can also be instructed to fire 1f an error condition arises on the power outputs either overload or open circuit or a failure in the power supply At power on the watch dog is disabled it can be configured and enabled by the PC or by the PLC cycle if present executed automatically at start up www xonelectronics it Page 5 12 K XON Electronics EZ Red User manual Configuration variables In the EZ Red flash memory it is possible to store not only a PLC cycle and a password but also a set of configuration data This way a single cycle can be adapted to different cases and the customer can be supplied with an ad hoc program to modify the configuration data without touching the PLC program The PLC cycle can also modify this configuration variables so the value will be retained for future sessions USB interface The EZ Red module connects to the computer through an USB interface with a standard connector USB Type B shown aside When the module is powered the USB cable connected and o s drivers installed two virtual serial ports will be available the first one USB Serial converter A 1s the communication channel while the second USB Serial converter B is not used amp Rimozione sicura dell hardware 4 5 i 1 EEE 21 This picture shows that the first channel A is S Selezionare
19. ter and an interface for channels A and B of a quadrature encoder with frequencies up to 10 Khz The three GND ground pins are internally connected Additional GND ground Input FX1 LEIS ees Analog inputs The two analog inputs AIN1 and AIN2 A1 and A2 on the connector accept analog voltages from 0 to 10 volts there is a protection circuit f which limits voltage to 10 volts Ingresso analogico AIN2 Ingresso analogico AIN www xonelectronics it Page 3 12 di XON Electronics EZ Red User manual 24V power outputs The eight power outputs Y1 Y8 can source each up to 2 7 SS a F yo amperes but no more than 4A in total all the currents cote he summed up They output the same voltage supplied as main power supply and are protected and monitored Their status overload and open broken circuit can be read by the computer or a PLC program Outputs 1 2 3 4 Outputs 5 6 7 8 Analog outputs 0 10V fa Vie wom The analog outputs AOUT and AOUT2 A1 and A2 on the connector _ can source about 20 mA at maximum and feature a protection circuit lt The output voltage ranges from 0 to 10 volts s _ Analog output AOUT2 Analog output AOUT 1 Auxiliary output power suppl 12 volt On the output side connector there is an auxil
20. the value from 0 to 255 proportional to the voltage at analog input 2 The functions explained below are simpler but require more communication Given the latency time and speed of the virtual serial communication the computer can send about 50 commands per second to the EZ Red Hence by using two separate calls to read inputs and write outputs the speed is halved Page 10 12 www xonelectronics it K XON Electronics EZ Red User manual ezrd_set_allouts parm cardinal This function sets all the power outputs together one bit for every output bit0 corresponds to output 1 and so on Please note that by using this function you modify all the outputs A cardinal is an unsigned 32 bit integer ezrd_set_io which1_8 cardinal onoff cardinal This function modifies a single output specified by WHICH1_8 use a number from 1 to 8 the new state is ON if ONOFF is 1 and OFF if ONOFF is zero ezrd_up ezrd_ ups These calls set a single power output to ON the output affected is the one indicated by the name of the function ezrd dni ezrd dng These functions turn off the corresponding output ezrd_set_ana1 parm cardinal Sets with a value from 0 to 255 the output voltage of the analog output 1 The voltage is proportional to the indicated value 0 means 0 volts and 255 means 10 volts so 128 means 5 volts ezrd_set_ana2 parm cardinal The same as before for the analog output 2 ezrd_read_ain1 var parm

Download Pdf Manuals

image

Related Search

Related Contents

  LG Electronics 37LD665H Flat Panel Television User Manual  Manuale istruzioni (italiano)  

Copyright © All rights reserved.
Failed to retrieve file