Click PLC Serial Send Help

David1224

Member
Join Date
Nov 2013
Location
Ohio
Posts
19
Hello everyone,

I am trying to use port 2 on a Click PLC to send a few simple commands to a third party servo drive over RS232. I need to send four consecutive bytes to the drive to run the motor at a constant speed. For my testing, I am using the send command to send ($7F), ($8A), ($BC), ($C5) to the drive but I'm not having any luck. I have verified that the port settings match the drive requirements.

The servo drive does exactly what I want when using the test software that was supplied with it, so I used a serial port monitoring software to verify what was being sent to the drive. It shows each byte on a separate line.

When I send the same data using the Click, the serial monitor shows everything on one line. I have tried using one send command with all four bytes and I have tried separate send commands, each enabled by the previous command's "success" bit.

Anyone have any ideas? I'm not very experienced with serial communications so any help is greatly appreciated!

Click PLC Output.PNG Test Software Output.PNG
 
Perhaps send a carriage return after each byte? Are you seeing 0D in any of the other windows of the serial port monitor?
 
Down at the bottom of the ASCII Send box is an option to send one or two termination characters. Check box, two characters, [ $0D ] and [ $0A ].
That sends carriage return and line feed.
It might just need one character, [ $0D ]. Carriage return. That's the character shawn_75 was looking for.
 
I just added a CR after each byte and I've attached a picture of the result. Still all on one line in the serial monitor.

I'm not familiar with the monitoring software to understand the difference between the single and multiple line results, but it refers to each line as a different packet.

I have contacted Automation Direct tech support but was only referred to sample code, which didn't seem to help much.

Thanks for everyone's input.

Click PLC with CR Output.PNG
 
keithkyll,

I tried your suggestion and get similar results with everything on line. Is it possible that I need to do something to "close" the port between bytes? I was told that the drive doesn't send anything back unless requested, however my serial monitor from the drive's test software show that some bytes were "read" while sending the test function.
 
Try only one carriage return at the very end. Lots of serial stuff I've worked with (both industrial and consumer/commercial) like some variant of a carriage return or line feed or something else to signify the end of the command. What model drive are you working with?
 
I tried a CR at the end but still not having any luck.

I am using a DMM-Technologies DYN2 drive. I have use them in the past with Pulse/Direction signals, but for this simple application I thought I'd try their built in RS232. I only need to run the motor to two fixed positions.

I'm using this manual (pages 41-57 describe the protocol):
http://dmm-tech.com/Files/DYN2MS-14F-0917A18.pdf

Everything I've tried with the Click program results in just about the same data (all on one line) in the serial port monitor. This is directly from the Click to a serial port on my PC. When connected to the drive, it does nothing, and I suspect it's because my data output doesn't perfectly match the test software's data output.
 
The test software shows 10-15 thousandths of a second between thee transmissions. It's possible these time delays trigger an action in the drive. Perhaps try to enforce a time separation between the transmissions using time delays.
 
keithkyll,

I tried your suggestion and get similar results with everything on line. Is it possible that I need to do something to "close" the port between bytes? I was told that the drive doesn't send anything back unless requested, however my serial monitor from the drive's test software show that some bytes were "read" while sending the test function.
It may be the responses from the drive that's clobbering transmissions. Add time delays as Bernie suggested, to allow time for a response. The drive might be sending an ACK after every command.
 
OkiePC would probably be helpful. Have you tried their tech support?

I don't have any experience with ASCII from a Click, but the experiences I do have with other PLCs were always a lot of trial and error to get it working right.

I concur with the advice given so far about timing and termination characters.
 
Just checked your manual.
With RS232 ASCII communications, you need to send a checksum.
From page 44:
"Packet = ID + packetLength + functioncode + data + checksum"
Checksum is B0. Calculation is shown on page 47.

It may be easier to switch over to RS485, and use MODBUS.
 
I have now experimented with time delays (from 1-100ms) while trying some of the four-byte examples from the manual. I also verified that the checksum I'm sending is correct. I have even tried alternating between send/receive commands in the Click, but still have not had any luck talking to the drive.

I am still keeping an eye on the data and have yet to be able to the bytes to separate lines, like the drive software does.

Modbus may be the easier option, but I would have to order a drive with RS485 support. I'm still hoping the RS232 will work!

Guess I'll have to sleep on it. Thanks again for the suggestions everyone.
 
You haven't mentioned it but a review of your electrical connections from the Click to the drive might be in order. As it mentions in the manual the serial port, while listed as RS232 actually isn't and requires TTL level signals. This level shift is provided by their required cable when connecting to your PC. Can you show the connections to the Click you are using?
 

Similar Topics

Complete noob here, using a Click C0-02DD1-D to run a test stand. Requirement is to turn on motor run for X seconds, turn off and dwell for X...
Replies
6
Views
1,062
merry christmas and happy new year i have a click c0-00dr-d and allen bradley 2711c-t3m. can the panelview talk to the click plc via modbus...
Replies
1
Views
204
Hi guys, i have never had to do a PWM Output or input before i have a Device that to dimm the lamp output from the ballast, the ballast has a 24V...
Replies
6
Views
1,009
I am trying to set a bit to command the Zebra ZT230 to print a label and receive a confirmation bit from the unit via an Automation Direct Click...
Replies
0
Views
662
Hi All, I have a click plc the I need to bit strip and 16Bit int. This is to get the alarms from these bits in the int. Do anyone know how to bit...
Replies
1
Views
500
Back
Top Bottom