AndreasW

MrPLC Member
  • Content count

    77
  • Joined

  • Last visited

Everything posted by AndreasW

  1. MITSUBISHI SERVO DRIVE MRJ4 200 A RJ

    hi vipin, you should check the servo setup.With regard to the travel distance, there are two essential parameters - number of pulse per rotation (depends of encoder resolution) - movement amount per rotation (including the gear ration) I would first compare these two settings    
  2. Mitsubishi FX5 read/write from PC with nodejs

    no you can't read data from the sd card by SLMP/MC-Protocol, but you can use the FTP functions to access the sd-card, hava a look at chapter 8 and 9 of the Ethernet Communication manual https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d56201/jy997d56201q.pdf  
  3. Mitsubishi FX5 read/write from PC with nodejs

    To read D2050 the string should be "01FF000A4420000008020100" "01 FF 000A 4420 00000802 01 00"    --> 01 (cmd)... batch read 1 word unit --> FF (pcnr, fixed) --> 000A (timeout 10x250ms= 2.5sec) --> 4420 (devcode for d-register) --> 00000802 (start adress in hex h802= decimal 2050) --> 01 (counter in hex= h01= decimal 01 = 1 register) --> 00 (end, fixed)    
  4. Mitsubishi FX5 read/write from PC with nodejs

    the node.js code was just an example, the connection is closed by the client.end() command set after receiving the response from the plc. if you wan't to check every 2-3 seconds you can use the setInterval methode, something like this: but this is also just an example:     const Net = require('net');         // Include Nodejs' net module. const port = 8080;                  // The port number and hostname of the plc. const host = 'localhost'; const requestString= '04010001A8000001000A';    // the RequestString to READ your data from the plc const client = new Net.Socket();    // create socket let requestInterval= null;          // request interval let timeout= null;                  // request timeout // EndConnection, called to destroy the socket and clear request interval and timeout function EndConnection() {     if (requestInterval != null)     {         clearInterval(requestInterval);         requestInterval= null;     }     if (timeout != null)     {         clearTimeout(timeout);         timeout= null;     }     console.debug('disconnect from plc, terminate connection');     client.destroy(); } // ReadDataFromPLC, send RequestString to plc function ReadDataFromPLC() {     // check if socket is ready     if (client.readyState != 'open')     {   // socket not connected,         console.debug('error: socket/plc not ready for sending ReadRequest');         EndConnection();     }     else     {   // socket is ready, check if Timeout for last ReadRequest occured         if (timeout== null)         {   // socket is open, send 'ReadRequest' to plc and set timeout for the response,             // timeout will cleared when data received from plc             // !!!! TimeOut 'time' should be smaller than Interval 'time'             console.debug('send Request to plc....');             client.write(requestString, ()=>{                 timeout= setTimeout(()=> {                     console.debug('error: timeout occured, no data received for last ReadRequest');                     EndConnection();                 }, 1500);             });         }         else{             // if there is no response from the plc for the last ReadRequest,             // don't send a new readRequest             console.debug('error: no data received for last ReadRequest ');             EndConnection();         }     } } // connect to plc, set Interval to 3seconds (3000ms) client.connect({ port: port, host: host }, function() {     console.debug('TCP connection established with the plc.');     requestInterval= setInterval( ReadDataFromPLC, 3000); }); // handle connection termination, e.g. server/plc close connection client.on('end', function() {     console.debug('Requested an end to the TCP connection');     EndConnection(); }); // handle socket error client.on('error', function(err) {     console.log(`socket error occured ${err.toString()}`);     EndConnection(); }); // handle response from plc client.on('data', function(chunk) {     console.debug(`Data received from the plc: ${chunk.toString()}.`);     // clear TimeOut for ReadRequest     if (timeout != null)     {            clearTimeout(timeout);         timeout= null;     }     /////////////////////////////////////////////////////     // TODO: check received data, verify response string,     ///////////////////////////////////////////////////// });          
  5. Specific Time to energize an output

    you can compare the data register or use the tcmp function M0 is an internal relay, not an output. Outputs are Y___ eg. Y1 If you SET M or Y it will stay on and doesn't get reset. Either you add a RST command to reset the relay/output or you can use a self-holding of the output using an timer e.g. T0 is a 100ms Timer, so T0 K10 means 1second e.g check which outputs and timers you can use so that they do not collide with the existing PLC program      
  6. Specific Time to energize an output

    in general, the internal clock of the plc can be used for this purpose. the internal clock can be queried in the program via special registers (depending on the plc type) and can be used to switch an output. However, it must be taken into account that the internal clock of the plc usually does not run completely accurately over a longer period of time and that it shows a deviation after some time. Ideally, the plc should be able to synchronize its clock, for example using a NTP server (network time protocol) available in the network (if plc has ethernet), although not all FX CPUs support this. also the summer/winter time changeover is mostly still to be considered, since this won't change automatically. I think the main problem is therefore not so much to switch an output at a given time, but rather to have the clock of the plc accurate.    
  7. E1101 Controller Data Exchange

    i think this should be possible with the device data transfer function, see chapter 9.4 in the screen design manual http://www.factoryautmation.com/downloadfile/D2119_Mitsubishi_sh081220engl.pdf, never used it with modbus, only with two plc, but i think if you can add a second controller of type MODBUS it should work, but you have tor try it. be sure to install the required modbus driver and the data transfer system package (system application) in the GOT (see chapter 4.2 in the manual).    
  8. E1101 Controller Data Exchange

    hi, i think 400000 should be the function code for read holding register, maybe you will find more information inside the MDOBUS driver manual for the E-Series http://suport.siriustrading.ro/02.DocArh/09.MS/02.HMI/02.MAC,E,E1000/04.Manuale%20drivere/02.Drivere%20Terti/Modbus%20Master%20ASCII,%20RTU,%20TCP%20-%20Manual%20Driver%20MA-00344-B%20(03.01).PDF    
  9. Mitsubishi FX5 read/write from PC with nodejs

    in short: not exact but in general yes (when using the ASCII version) some more details, but don't let it confuse you: the 'original' mc-protocol is primary used with serial connection, using the build in ethernet you can use the SLMP protocol instead, but the SLMP protocol use the same frame-types (3E/1E) as the mc-protocol. There are two protocol types supported: binary and ascii. It's easy when you use ASCII-format, because in this case the frame defines the format ( [CMD][PCNR][TIMEOUT][DEVCODE][ADDR][COUNT][ENDCODE] )  and the number of digits of each part. Every digit is coded as 1 byte using the ASCII code assignment. And this is what the node-net module does, it takes a an ascii coded string, build an tcp-packet an put each character as 1 byte into the payload of the tcp-packet. This is why its easy to use, all you have to do is building the 'right' ascii-sendstring following the frame (format/number of digits). Using the binary version is also be possible, but would be a little bit more complicated, because you can't use the net.Socket.write() function. In this case  you would have to build the senddata byte by byte and you have to care about endianess so using the ascii version is easier.    
  10. Mitsubishi FX5 read/write from PC with nodejs

    Hi DavidOtt, the version to check is the firmware version of the plc, (see Appendix4 in https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d56001/jy997d56001j.pdf) not the version for node module.   In nodejs code you wrote:  client.write('01FF000A44200000000A0200');      // read D10,D11  Client.write is not a writing command? Because you wrote in comment: // read D10,D11  in nodejs you have to send a command (WRITE) to the plc. If this command reads/writes depends only of the content of the send string, sending '01FF...' is a batch read command, that will response with the values of the requested registers; sending '03FF...' is a batch write command, that will set values of the registers upon the data given in the sendstring    
  11. Mitsubishi FX5 read/write from PC with nodejs

    Hi DavidOtt, first check the required firmwareversion for the fx5, for mc this should be at least v1.240 otherwise mc-protocol won't work; if your version is lower then you have to update the firmware via sd-card download of firware_update:       https://www.mitsubishielectric.com/fa/download/software/cnt/plc/index.html#cat_melsec-fx_series fimrware update procedure:        Chapter 5/ (SD-Card required) https://www.mitsubishifa.co.th/files/dl/jy997d55401j_FX5(Application).pdf if firmwareversion is ok, you can setup the protocol settings Communication Data code: ASCII (HEX) or ASCII(OCT) if you prefer octal instead of hexadecimal adressing and values; Add an SLMP connection and setup the port; be sure to write changed ethernet module settings to the plc. for the built in ethernet port the FX5 cpu uses the 1E-frame, see SLMP Manual, Chapter 3.2 "1E-Frame" https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d56001/jy997d56001j.pdf the Message Format is data:  [CMD][PCNR][TIMEOUT][DEVCODE][ADDR][COUNT][ENDCODE] digits:  2    2      4        4       8      2      2 CMD:    see chapter5/  01..batch read 1 word unit, 03... batch write PCNR:    FF (fixed) TIMEOUT: 0000 wait unlimited or timeout in units of 250ms DEVCODE: see page 123 (device range)          D-register ... 4420          M-register...  4D20 COUNT:    2digit HEX/0A... 10Register END:    00 (fixed)   so to read D10...D15 (5 words) command is: "01FF000A44200000000A0500"    --> 01 (cmd)... batch read 1 word unit --> FF (pcnr, fixed) --> 000A (timeout 10x250ms= 2.5sec) --> 4420 (devcode for d-register) --> 0000000A (start adress in hex = 10 decimal) --> 05 (counter in hex= 5), (to read 10 register it would be 0A) --> 00 (end, fixed) response "8100xxxxyyyyzzzz"  (x,y,z = hex value of registers, each 4 digits) to write D10=255, D11=20, D12= 27 "03FF000A44200000000A030000FF0014001B" --> 03 (cmd)... batch write 1 word unit --> FF (pcnr, fixed) --> 000A (timeout 10x250ms= 2.5sec) --> 4420 (devcode for d-register) --> 0000000A (start adress in hex = 10 decimal) --> 03 (counter in hex= 3) --> 00 (end, fixed) --> 00FF (first value in hex, FF=255) --> 0014 (second value in hex= 20) --> 001B (third value in hex = 27)   for node js you only need the net module /////////////// TEST.JS /////////////////////////////////////////////// var net = require('net'); var client = new net.Socket(); client.connect(1000, '172.25.110.7', function() {      //change ip and port     console.log('Connected');     client.write('01FF000A44200000000A0200');      // read D10,D11 }); client.on('data', function(data) {     console.log('Received: ' + data);     client.end(); }); client.on('close', function() {     console.log('Connection closed'); }); //////////////////////////////////////////////////////////////////
  12. Mitsubishi FX5 read/write from PC with nodejs

    Hi DavidOtt, if you wan't to use modbus you can setup the modbus register inside the plc ethernet configuration. you first have to add a modbus-tcp-connection inside the external device configuration (see chapter 12 https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d56101/jy997d56101g.pdf) then you can assign the required devices for the different modbus function (read/write coil, input, input register, holding register,...). beside this, i still think that using the mcprotocol may be easier, and you don't need a special node library for this, just create a socket and send the request string (ascii-string) from node js (only 'net'-module is required for the socket)
  13. Mitsubishi FX5 read/write from PC with nodejs

    Hi DavidOtt, i don't know the mcprotocol library for node.js you referenced, but you can use the mcprotocoll to read/write data from/to mitsubishi plc. you can't handle it with html only, but with javascript and ethernet communication it shouldn't be a problem. in this case the plc act as server, you establish a connection and then send the request (read/write, registertype, number of register) and the the plc will respond. the request is handled at the end of the normal scan cycle of the plc. the mcprotocoll is described in the melsec communication protocol manual,  https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d60801/jy997d60801f.pdf there are two types of the mcprotocoll ascii and binary, if you use nodejs/javascript using the ascii version should be easier, beacuse you you can use ASCII-character to build the REQUEST string you send to the plc and doesn't need to handle byte values in the senddata. for a list of possible devices you can read/write have a look at the application manual chapter 28 devices, https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d55401/jy997d55401t.pdf in short you can use D (Data register) or R (file register) for signed/unsigend 16/32bit data (32bit require two registers) and M (internal relay) or L (latch relay) for bit-data (true/false). to send an timestamp (js) you have split it into the different parts (hour, minute, second) and send this in different registers, because the plc doesn't have a datatype for date/time representation. whitch register you can use, depends on the program on the plc. be sure that you don't use (write to) registers that are used by the plc program. If you need read/write synchronisation for the data you also need to implement this on the plc side. list of manuals https://www.mitsubishielectric.com/app/fa/download/search.do?kisyu=/plcf&mode=manual If you need a tool to test the communication, you can use the HERCULES Setup utility https://www.hw-group.com/software/hercules-setup-utility
  14. Need help with Mitsubishi GS2107-WTBD

    hi, did you install the support for the GS-Series, GT Designer3 does not support the GS Series when you install it, you have to install the GS-Series support after installing GTD3 software. Run the GS Installer.exe from the Disk1\tool\gs directory of the gtworks3 installation disk  
  15. Melsec FX5U ASCII string sending thru ethernet.

    hi, its not a problem, use the Socket Communication Functions, first open a socket/connection (SP.SOCOPEN command) and then send the Data (SP.SOCSND command). you should have a look at the User Manual (Ethernet Communication), Chapter 7 (Socket Communication Function) https://www.mitsubishielectric.com/app/fa/download/search.do?kisyu=/plcf&mode=manual https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d56201/jy997d56201q.pdf   If you need a tool to test the communication, you can use the HERCULES Setup utility https://www.hw-group.com/software/hercules-setup-utility        
  16. Configure two HMIs

    Hi gman1, technically it is no problem to connect several HMIs to one PLC. If necessary, you have to enter another MELSOFT connection in the network settings of the PLC, so that both HMIs can access the controller at the same time. For a good user experience, make sure that the names and messages on both HMIs are the same and that the display of data values on both HMIs is the same (no problem if PLC data registers are used, this is not always the case with internal data registers of the HMI).
  17. GT Designer 3 Display/Hide an Image

    Hi PeterParker, ok, the Bit-Lamp will be in the foreground, and as far as i know you can't draw any shapes in front of the lamp. But do you need the lines to be drawn dynamically? Maybe you can add the lines (from the holes to the buttons) to the images of the holder? If you use a bit/word lamp you can assign different shapes(images) to each lamp state, so changing the lamp-state will also change the image (with the lines). For two images use a bit-lamp, if you need more states use a word lamp. I think this would be the easiest way. Changing the State should hide/disable the buttons for the FLX-1 and at the same time change the state of the Bit/Word-Lamp to the state with the propper image. To easily create the Image of the holder+lines, you can use the preview function and then create a screenshot of the preview (without the gridlines and the button-borders, ...)
  18. GT Designer 3 Display/Hide an Image

    Hi PeterParker, you can add your image (bitmap, jpeg) to the user library and then use a normal Bit-/Word-Lamp or a Switch/Button control object. There you only have to change 'shape' attribute and select your image from the library, and you also can use the control display/hiding feature. If you need to show/hide a lot of images at the same time, you can use the 'Parts'-Functions instead of showing/hiding the individual images.    
  19. Continous path positioning with M code in QD77MS

    hi vanquangtk, i don't think that this will work with the continous path control, i think you have to use 'position speed siwitching control' (see 9.2.18 in the manual https://dl.mitsubishielectric.com/dl/fa/document/manual/ssc/ib0300185/ib0300185f.pdf) also have a look at 5.1.6 (setting items for position data, [Da.1] operation pattern); you can see that speed/pos switching isn't available for continous path or continous positioning mode.
  20. Continous path positioning with M code in QD77MS

    hi vanquangtk, I think that the positioning jumps to the next point is ok, because this is the basic function of the continous path positioning mode. If you want to stop the positioning after reaching a point this should be done in the positioning complete mode. So what do you wan't to do with the the m-code signal? If you want to pause the positioning until the m-code is cleaered you should use positionig complete mode instead of continous path. If you wan't to detect that each position is reached you can try to immediately reset the m-code with an m-code-off request command (mabye within an event-interrupt) to detect the m-code of each point, but this will only work if the positioning time between the single points is long enough.  
  21. 32 Bit data transfer

    hi paul, to mov 32bit data just use the DMOV instruction as you did, you only should note that the other registers you will use to hold the other values are also 32bit: DMOV C235 D0 --> writes D0, D1 DMOV K10   D2 --> writes D2, D3 DMOV K20   D4 --> writes D4, D5 to compare values, for example C235 and K10 you can use the normal compare functions togehter with 'D' to indicate that it should compare a 32bit value (compare functions D=, D<, D>, D<>)  e.g. 'D= D0 D2' (compare D0/C235 and D2/K10)   Be sure not to mix 16/32bit instructions, for example using '= D0, D2' (what is wrong) would compile, but only compare 16bit, this can work with appropriate values, so that this error is not directly noticeable, but if only the upper 16bit would differ, the comparison would give a wrong result. for fx5/ (gxworks3) there is an option in the compile settings that will generate a warning if the data type and the instructions doesn't match, not sure if this option exist in gxworks2 one last note regarding the high-speed counter and why 'DMOV C235 D0' won't work as expected. This is due to the fact that the system updates the (high-speed) counter outside the scan cycle and therefore it is not guaranteed that the read value corresponds to the current counter value. Therefore, the high-speed counters have their own instructions for setting, resetting, comparing and reading (at least for the FX3U).  
  22. 32 Bit data transfer

    hi Paul, seems that for the FX3s the instruction isn't available (see chapter 24.5in the programming manual) https://dl.mitsubishielectric.com/dl/fa/document/manual/plc_fx/jy997d16601/jy997d16601q.pdf have a look at the high-speed processing instructions 13.4-13.6  
  23. 32 Bit data transfer

    hi Paul KAV, high-speed counter can't be transfered with a DMOV instruction, you have to use the HCMOV(16bit), DHCMOV(32bit) instructions to transfer the counter value to a D-Register., There is also the DHSCS Instructtion to compare the counter with an given value.    
  24. Using HOURM as Retentive Counter

    Hello Levent, this should work, but make sure that you reserve space for two 16bit devices, as d1 and also d1+1 are used, as described in the processing details on page 793 of the FX5 Programming manual (https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d55801/jy997d55801r.pdf) you should have a look at the declaration of the label 'Betriebsstundenzaehler', either assign a latched 16bit device (if declraed als global label) or set it to be an array of 2 elements if specified as a local label. In the second case you should use 'Betriebsstunndenzaehler[0]' for d1. Also you should be sure to handle the case, that the maximum 16bit value is reached witch will happen after about 7.5 years (65535/ (360days x 24h)), this is the reason we normaly don't use the 'hour_m' function and implement the operating hour counter by ourselve using an unsigned double word (32bit).   hope this helps
  25. Wireless programming fx3g

    Hi, like Crossbow wrote the most cheap devices require a driver to operate and won't work with a plc. If you want to provide a Bluetooth or WLAN interface for a machine, this could possibly be the suitable system https://www.anybus.com/de/produkte/wireless-loesungen/wireless-bolt https://www.anybus.com/de/produkte/wireless-loesungen/wireless-bolt/detail/anybus-wireless-bolt---ethernet-rj45-poe