Sign in to follow this  
Followers 0
jtaylor42

Serial Communicaton with an FX2N

4 posts in this topic

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sorry, I have not read the manual but your understanding and explantion seem sound. I would just try this with Hyperterminal connected to the PLC to test..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0