Jump to content

Recommended Posts

Posted
Hello, I am writing a vb program to collect data from several type of machines. One these has an FX2N PLC. I am using the MSCOMM component and all I need to do is to open the com port (I am using a virtual com serial ip driver) that is connected to the plc and issue a command to pull the data I need. I have read through the com and programming manuals for the FX2N but I am lost as to what the command is I have to send it as well as the format it has to be in. My client has been using MelDDE to collect some data in a spreadsheet on a laptop connected to the plc. Here is what they issue from a cell within the spread sheet to collect the data: =MelDDE|std!'y5' ; gets the part count =MelDDE|std!'m1000' ; determines if the plc is running in manual mode =MelDDE|std!'m1001' ; determines if the plc is running in automatic mode Can anyone tell me what I would need to send to the plc via the MSCOMM component or even just with a terminal program connected to it in order to get the same info? Any help would be greatly appreciated. Thanks
Posted
For starters look at the linked thread and get the comm's manual. Mitsu Serial Comms Secondly have you any experience with VB at all? Look in the download section under omron and there is a VB program that will talk to omron plc's, you should be able to use this to see how to use mscomm in your application. I havn;t checked the mitsu download section but there might be vb code there also.
Posted
Thanks for the reply! I am very familiar with vb and using the mscom component I am just unsure of what the plc is expecting to see. I looked at the omron vb example you mentioned. As an example, one the commands you can send to the plc from his program is: @00RD0000000157* I am not sure what this does but the entire data string sent to the plc is @ 00 ; the unit # RD00000001 ; the command 57 ; the checksum Chr$(13) This is what I am not sure about for reading data from an fx2n plc. From looking through the fxs2n communication manual it kind of looks like I would send the following string to Batch Read from from the M1000 auxiliary relay: ENQ00FFBRAM1000147 + CRLF Which is: ENQ ;Enquiry 00 ;Station FF ;PLC BR ;Command = Batch Read A ;Message Wait= 100ms M1000 ;Bit device to read 1 ;#of data points to read 47 ;Checksum In theory the plc would return: STX00FF0ETX05 if the bit is off and STX00FF1ETX05 if the bit is on Is my thinking right here?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...