Write VC++ program to get status from PLC

S

Thread Starter

steven

Hi guys... i am using NAIS PLC and a ET-LAN... i suppose to come up with a simple program using VC++ to get the status for all the 32x n 32y using the photocol of tcp/ip.

i search though the net but only got a few on chat server n client using tcp/ip. try reading many time on the winsock but still can really write a working one... If there any kind soul to help me i will thank a lot... if there so one working like a similar project. pls alot me to view yr code to get so hint on how to start... thanks alot.
 
Hi,

I have a working program for Visual Basic to read/write X, Y, DT from Ethernet. With Visual C++, I only tested out the communication with PLC via Ethernet.

Please go to NAIS website and download mewtocol manual and NAIS FP3/FP10S ET-LAN system Technical Manual. You will find NAIS message format in mewtocol manual and TCP/IP communication message format in ET-LAN System Manual.

Make sure that you set the TCP port number and IP Address correctly inside PLC. Then, you can use winsock to send the following TCP/IP message format.

Header + (total bytes in mewtocol command) + fixed data + destination unit no + PC unit no + (mewtocol command)

Headers is two character, Hexadecimal 10 followed by 0.
Fixed data is six characters of 0. Destination number is PLC unit no set inside PLC. PC number can be any number that is different from PLC unit no.

Details of Mewtocol command can be find inside mewtocol manual.For example, %01#RCSX0000**<cr> is an example of mewtocol command to read the contact X0 from PLC unit no 01.
 
Thanks for the great tip. i study the mewtocol format and got a idea of how it like. but i need to rush out a sample program. u think it possible i take a peek at yr program?
thanks again.
 
Hi...

I know yr a busy person, but it seem like yr the only person that know better what situation i'm in... would love and be glad to hear from u.

my email is [email protected]

btw the et-lan come with a mac address right?? so i need to get the ip add..

is it possible to use a chat program and mod it to wht i want..

btw will be glad if u could let me take a look at yr program.

if not, it ok for i still need yr guidedance.. thanks again.
 
how to setup the address inside yr et-lan.
I dont have the configurator et program.
so therefore i must use fp win gr to write (ladder program).
is that the only way??

if so just show a small sample pls.
 
Hi,
i am also doing on the same project which to read/write status from the PLC, which i have to come out with a program using VS C#.

i have gone through the mewtocol and roughly know what is going on in it. But i and still seeking help in the communication part where on how to request the PLC to transfer the file over.

the testing part i only done it with the ET Lan. And is it possible to convert the hexadecimals value to binary using VS C#?

I am still very new to all this so i hope anyone could give me some guide in going on.

Thanks alot guys.
 
Top