Communication Modicon - VB6

jcurado

Member
Join Date
Sep 2003
Posts
49
I’m trying to communicate from my PLC Modicon Premium with a VB6 program over the TER port.
I can easily send information from PLC to PC but I’m unable send anything from the PC to the PLC. I’ve tried with Out_in_char and Print_char/input_char without success.

The basic stuff should be correct otherwise I couldn’t read anything on the PC.

The most annoying is that I did this once and don’t know how (I had a problem with the laptop were the programs were)

If anyone had done this I could really appreciate the help. I’m stuck with this for two days now. I believe that I need some external ideas to clear my mind.


Hope you can understand my “English”


João
 
Character strings

You say you are able to write from the PLC to the PC, so I would agree that you probably have the correct setup. I do have afew questions, before I make any suggestions:

How are you doing your handshaking/flow control? How do you signal the "end of message"?

Have you used the "communication debugging" screens?

How is the PC->PLC communication initiated, by the PC or the PLC? The teminal port can only be setup with a single communication function type, use OUT_IN_CHAR if you need the PLC to send a request and then wait for a reply.
 
Jim

Thank you for your answer

I do need a reply from the PC, so I will use the OUT_IN_CHAR.

I can’t change anything in the flow control/handshaking in the terminal port (is all grey out). I use a TSX PCX1030 cable and I change the internal switch to character mode to communicate with VB6 and then back when I want to use PL7PRO.

I send an OUT_IN_CHAR every 5sec with 40 %MB.
In Visual Basic I Open communication port and read with “.input” then I use “.output” to send a string ended with “$R”.

The only debugging screen I had used was the VB debug mode to see what was in the input. I can also see the string that I plan to send to PLC. I cannot use any debug in PL7 PRO because I’m using the port (and the laptop) at the same time with the VB.



João
 
Your processor has two ports TERM and AUX. Do you have a second cable so you can connect your PC to the aux port?

Are your getting any information in the Exchange Report registers(i.e. length of string sent or length of string received)?
 
PLC comunications

I do have a second cable.

I'm home now I don't have the PLC with me.

I'll connect a second PC tomorrow and see the registers.

I will post the result in the morning.

Thank you for your help.



João
 
PCL Comunnications

Jim


I tried to communicate with the two PC at the same time.

I started with PL7 PRO in the terminal port, and then connected the other cable on the auxiliary port. At this point the PL7 PRO communication fails.

I cannot communicate with both computers at the same time.

Seems I’m not able to see the internal registers of the PLC. I can try to connect an Magelis in the other port and write the words to the display, but don’t know if it will work.

If you have any other suggestions, please let me know


João
 
Timing is the key with Modbus.

Have you read the specifications about the spacing between characters?
How do you guarantee that you don't have gaps between the characters that the PC is sending to the PLC?

When debugging Modbus you must start with small packets and a lower bit rate. After the basic protocol and CRC is debugged the you can start trying bigger packets and higher bit rates.

The PC can be very slow at reloading the serial chip when an interrupt occurs. It is best to use buffered serial chips such
as the 16550 or better. You should also make sure the serial chip
generates the transmitter empty interrupt before the transmit buffer is empty. There is a place where the buffer empty and buffer full threshold can be set in windows.
 

Similar Topics

Hello, I'm having a hard time understanding how to get a Modicon M340 to pull a Modbus address from an ABB Totalflow via Ethernet. I set up a port...
Replies
5
Views
1,152
System Details: We use hot redundant Modicon Quantum PLC with dual redundant communication having Remote IO racks (using CRP + CRA cards and...
Replies
0
Views
775
I've got an M340 hitting an Ethernet to Serial converter one read at a time. Each read is enabled through a one-shot r_trig. I've got some extra...
Replies
2
Views
1,594
I am trying to send data from an older modicon quantum plc via an NOE card to a compact logix plc with built in Ethernet. I am familiar doing this...
Replies
7
Views
2,617
we use M580 which have an Modbus RTU port correct if iam wrong now should i have to read input data from ab micrologix through read var block and...
Replies
0
Views
1,861
Back
Top Bottom