Johnny T
Member
Hi all
I started a similar topic to this a while back when I was struggling to talk to some motors. The problem was that the card I had at the time (CP340) wouldn't go up to 19200 baud on ASCII. I've now got a CP341 card and so need help setting it up.
I've spent a day and a half now messing around with it and I'm getting nowhere... I shall explain what I've done and where I'm up to in the hope that you can point in me in the right direction...
Right.. here goes...
I'm trying to communicate with a MAC servo motor. I can talk to it via a free little program they give you called MACregIO. When you send a command to the motor via this program, it shows you the string that it is sending.
Here's what the manual says...
The protected bit means that you send a byte and its opposite so that the motor can double check its correct.
So.. here's an example of a string I want to send...
I've installed the CP341 module to my rack (its in slot 5) and I've called FB8 (P_SND_RK) with the following info...
Basically I'm one-shotting I0.5 and saying to send 20 bytes of information starting from DB80.DBB0 (as far as I understand it).
Now... In DB80 I have the following....
This should send the position of 0 (ie. the four words of 00FF) to motor address 2.
But.... nothing
The M100.3 (DONE) marker comes on when I trigger FB8 but apart from that I get nothing.
I've routed the output into HyperTerminal and I get a string out of the CP341 but something tells me its not working correctly.
It seems like sometimes when I change the DB80 its still sending the same string out (do you need to somehow re-initialise the card before every send?)
The motors aren't doing diddly squat. I've tried using all DWORDS in the datablock, all BYTES, all WORDS.. combinations of the above. I've tried reversing the string ie. FD02 instead of 2FD but all to no avail.
I've exhausted everything I can think of so thought I'd put the question to the experts on here in the hope that someone can steer me in the right direction.
By the way, I've tried the example program (in the Step7 Examples folder) for P2P comms using ASCII but I just get the SF light on my PLC and it doesn't work for some reason (I did change the CP341 address in the program as it requests - but still SF light).
Has anyone got an example program, preferably written in Ladder, that could maybe help me out?
Does anyone know if there is some extra setting up/initialisation that needs to be done with the CP341 for correct use?
Many thanks for your help
Cheers
JT
I started a similar topic to this a while back when I was struggling to talk to some motors. The problem was that the card I had at the time (CP340) wouldn't go up to 19200 baud on ASCII. I've now got a CP341 card and so need help setting it up.
I've spent a day and a half now messing around with it and I'm getting nowhere... I shall explain what I've done and where I'm up to in the hope that you can point in me in the right direction...
Right.. here goes...
I'm trying to communicate with a MAC servo motor. I can talk to it via a free little program they give you called MACregIO. When you send a command to the motor via this program, it shows you the string that it is sending.
Here's what the manual says...
Block Name Protected [font=DEKEEP+Arial,Bold](1) [/font]Example Description
[font=DEHIBG+Arial]<Write> [/font][font=DEHIBG+Arial]No 52[/font][font=DEHIBG+Arial]h,52h,52h [/font][font=DEHIBG+Arial]Write command[/font]
[font=DEHIBG+Arial]<Address> [/font][font=DEHIBG+Arial]Yes [/font][font=DEHIBG+Arial]07h,F8h (Address 7) [/font][font=DEHIBG+Arial]The address of the MAC motor[/font]
[font=DEHIBG+Arial]<RegNum> [/font][font=DEHIBG+Arial]Yes [/font][font=DEHIBG+Arial]05h,FAh (RegNum 5) [/font][font=DEHIBG+Arial]The register number to write to[/font]
[font=DEHIBG+Arial]<Len> [/font][font=DEHIBG+Arial]Yes [/font][font=DEHIBG+Arial]02h,FDh (Len = 2) [/font][font=DEHIBG+Arial]The number of data bytes[/font]
[font=DEHIBG+Arial]<Data> [/font][font=DEHIBG+Arial]Yes [/font][font=DEHIBG+Arial]E8h,17h, 03h,FCh [/font][font=DEHIBG+Arial](Data = 1000) [/font][font=DEHIBG+Arial]The data to write to the register[/font]
[font=DEHIBG+Arial]<End> [/font][font=DEHIBG+Arial]No [/font][font=DEHIBG+Arial]AAh, AAh [/font][font=DEHIBG+Arial]Command termination[/font]
The protected bit means that you send a byte and its opposite so that the motor can double check its correct.
So.. here's an example of a string I want to send...
Write 230,000 (38270h) to register 3 (32 bit) to the MAC motor with address 2.[font=DEJIAO+Humanst521BT][/font]
Transmit:52h,52h,52h - 02h,FDh - 03h,FCh - 04h,FBh - 70h,8Fh,82h,7Dh,03h,FCh,00h,FFh - AAh, AAh
I've installed the CP341 module to my rack (its in slot 5) and I've called FB8 (P_SND_RK) with the following info...
A I 0.5
FP M 99.5
= L 20.0
BLD 103
AN M 90.0
JNB _001
CALL "P_SND_RK" , DB114
SF :=
REQ :=L20.0
R :=
LADDR :=272
DB_NO :=80
DBB_NO :=0
LEN :=20
R_CPU_NO:=
R_TYP :=
R_NO :=
R_OFFSET:=
R_CF_BYT:=
R_CF_BIT:=
DONE :=M100.3
ERROR :=M100.4
STATUS :=MW104
_001: NOP 0
Basically I'm one-shotting I0.5 and saying to send 20 bytes of information starting from DB80.DBB0 (as far as I understand it).
Now... In DB80 I have the following....
Address Struct Value
0.0 BYTE 0
1.0 BYTE 52
2.0 BYTE 52
3.0 BYTE 52
4.0 WORD 2FD
6.0 WORD 3FC
8.0 WORD 4FB
10.0 WORD FF
12.0 WORD FF
14.0 WORD FF
16.0 WORD FF
18.0 WORD AAAA
This should send the position of 0 (ie. the four words of 00FF) to motor address 2.
But.... nothing
The M100.3 (DONE) marker comes on when I trigger FB8 but apart from that I get nothing.
I've routed the output into HyperTerminal and I get a string out of the CP341 but something tells me its not working correctly.
It seems like sometimes when I change the DB80 its still sending the same string out (do you need to somehow re-initialise the card before every send?)
The motors aren't doing diddly squat. I've tried using all DWORDS in the datablock, all BYTES, all WORDS.. combinations of the above. I've tried reversing the string ie. FD02 instead of 2FD but all to no avail.
I've exhausted everything I can think of so thought I'd put the question to the experts on here in the hope that someone can steer me in the right direction.
By the way, I've tried the example program (in the Step7 Examples folder) for P2P comms using ASCII but I just get the SF light on my PLC and it doesn't work for some reason (I did change the CP341 address in the program as it requests - but still SF light).
Has anyone got an example program, preferably written in Ladder, that could maybe help me out?
Does anyone know if there is some extra setting up/initialisation that needs to be done with the CP341 for correct use?
Many thanks for your help
Cheers
JT
Last edited: