CHOO

Omron PLC nx1p2-9024dt PC Communication

2 posts in this topic

Hi Everyone,

I am new to PLC , hope can get help from the below requirement.

I have project need to send message from pc to PLC via TCP IP and i am using VB.net programming.

1. I have write program to receive data from PLC is working. PC will send back the message when receive the data from PLC and PLC able to received too.

2. I have another program need to send the message from PC to PLC by IP Address and port but every time i connect will get the error message not reachable for destination port. I check with the PLC supplier they say the Port no already open for listening the incoming data.

My objective is to send a message to PLC to do some action after complete PLC will send back the complete status. If able to provide coding example is much appreciated.

Regards

Choo 

Share this post


Link to post
Share on other sites

Just to clarify: you have just one PC or multiple PCs?

Have you tested with putty or something similar to eliminate the possibility of a program error on the PC?

Can you share your program?

Socket communication is pretty straight forward in Sysmac:

  1. Enable the SktTCPAccept function block with the port specified
  2. The Done output will become true when the PC connects to the PLC
  3. Execute the SktGetTCPStatus block at a regular interval to check if any data has been received
  4. Use SktTCPSend and SktTCPRcv to retrieve data from the buffer or send data to the PC

I attached a rather unpolished test program I have used in the past

TCP Socket .smc2

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