Sign in to follow this  
Followers 0
jtaylor42

Listening on a COM Port for Data from an FX2N

6 posts in this topic

I am reading data from an FX2N via the COM port. I have the device Y5 desingateded as the end of cycle "part count". Currenty, in order to get the data I have to write to the plc via the com port with a sting that tells it to send back the data for the 1st Byte of the Y device. I then compare the result with a byte mask to see if the bit at position 5 is a 1 or 0. I am doing this every 200ms to make sure I can capture in changes in the bit. This all works. My question: Is there a way to configure the plc so that I all I have to do is open the com port to the PLC and just listen for the data (ie Y5 changing from a 0 to a 1) instead of having to send the write string and waiting for the response every time? The kicker is I am also reading 2 values from the X device. So I would need my program to just open the com port and wait for a "data recieved event". When this happens I would get the data, determine which device and byte it came from, and record the value. Is this possible? Thanks in advance.

Share this post


Link to post
Share on other sites
You did not specify what is communicating with your PLC. What device or software?

Share this post


Link to post
Share on other sites
I am using a vb 2005 program that I wrote to collect the data. The server it runs on is using virtual serial ports which are connected via ip to ethernet-serial converters on the other end. The plc's are connected to the ethernet-serial converters. It looks and acts just like a pc connected directly connected to plc via the com port.

Share this post


Link to post
Share on other sites
Where do you get the dde driver and how does it work? Do you have a link to some docmentation on it?

Share this post


Link to post
Share on other sites
Email me to truyzky@yahoo.com for the DDE driver details. Edited by Sergei Troizky

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