Notifications
Clear all

something urgent

9 Posts
1 Users
0 Likes
10.6 K Views
(@Jimmy)
Posts: 22
Eminent Member Guest
Topic starter
 

Cannot establish a link to motors through RS232 after i download a program to the motor。The program is as below。

A=500
V=1000000
P=0
O=0
G
OCHN(RS2,0,N,9600,1,8,D)
PRINT("RP",#13)
C0
IF LEN
a=GETCHR
IF a==13
G
P=0
PRINT("RP",#13)
ELSE
P=P*10
a=a-48
P=P+a
ENDIF
ENDIF
GOTO0
END

I don't know how to establish a new link to the motor。Please help me,thanks in advance,dears。

 
Posted : 28/12/2014 9:24 pm
(@csearcy)
Posts: 316
Reputable Member Guest
 

Hi Jimmy,
You have the OCHN command in the program that has the last parameter D ...this puts the motor in Data Mode(rarely used) and takes it out of Command Mode ...where the OCHN last parameter would be C.
To recover...
Go to the Communications Menu... and select Communication Lockup Wizard. Follow the directions to turn the power off and on and clicking when and where it tells you.
This will let you Clear the EEProm. After doing this you can cycle power and the motor will be back to all factory defaults.
You can call me on our US toll free number 1-888-356-0357 if you need further assistance.

 
Posted : 28/12/2014 9:34 pm
(@csearcy)
Posts: 316
Reputable Member Guest
 

The program example you showed above is only for writing a SmartMotor program that accepts commands from a custom host that cannot be replaced, and cannot send normal SmartMotor commands. This means that all of the normal Smartmotor commands will be ignored.
It is best to leave the SmartMotor in Command Mode, though you can still use the OCHN command to change the baud rate, parity, or stop bits. Just be sure the last parameter in the OCHN command is the letter C. This way, all of the normal commands can be used.

 
Posted : 28/12/2014 9:46 pm
(@Jimmy)
Posts: 22
Eminent Member Guest
Topic starter
 

Thanks a lot csearcy。I really appreciate it。But now I try to use my own PC to communicate with SmartServo。I have to use Data mode。If I download this code,could I use the blue terminal board in SMI to send information?And thank for giving me your number,but I am sorry to say that it isn't convenient to make a call,please forgive me。Thanks again。
Happy New Year!

 
Posted : 28/12/2014 10:07 pm
(@csearcy)
Posts: 316
Reputable Member Guest
 

Let's make sure you need Data mode first. What development software are you using on your PC? If you can send simple ASCII commands, such as A=100 V=100000 P=2000 G ..then you may not need Data mode.

 
Posted : 28/12/2014 10:10 pm
(@csearcy)
Posts: 0
New Member Guest
 

If you have a host PC application that cannot be changed, then Yes... you can use the Blue Terminal window to send commands. If you need to add any special Hex or other commands, you can open the "nose" icon... which is our Serial Data Analyzer. This will let you mix Hex, Decimal, and Characters as needed... though each one is transmitted immediately. If you only need to send ASCII characters and CR... then the Blue Terminal window should work well.
Please let me know if you need any further assistance.

-Chuck

 
Posted : 28/12/2014 10:19 pm
(@Jimmy)
Posts: 22
Eminent Member Guest
Topic starter
 

hi,csearcy。I want to use my own PC to communicate with SMART via RS232。And i have an example parser。The code is as below.

SADDR1
ECHO_OFF
PID4
KP=100
KD=500
F
A=1600
V=4000000
MP
mm=1 //Minus Flag to one
ss=0 //Main Checksum
tt=0 //Command-Only Checksum
nn=0 //Input Number to zero
yy=0
zz=0
al[0]=0
al[1]=0
al[2]=0
al[3]=0
p=0
q=104
ab
=0
OCHN(RS2,0,N,9600,1,8,D)
C10
IF LEN
vv=GETCHR
IF yy==0
ss=ss*2
ss=ss+vv
ab[q]=vv
q=q+1
ab[q]=0
ENDIF
IF vv<33
IF yy
zz=nn
ELSEIF nn
al
=nn*mm
nn=0
ENDIF
SWITCH tt
CASE 1173
GOSUB100
BREAK
CASE 1214
GOSUB200
BREAK
CASE 500
GOSUB300
BREAK
CASE 1239
GOSUB400
BREAK
DEFAULT
GOSUB500
BREAK
ENDS
ss=0
tt=0
al[0]=0
al[1]=0
al[2]=0
al[3]=0
p=0
nn=0
mm=1
yy=0
zz=0
q=104
ab[q]=0
ELSEIF vv==44
al
=nn*mm
nn=0
p=p+1
mm=1
ELSEIF vv==126
al
=nn*mm
nn=0
p=p+1
mm=1
yy=1
ELSE
IF vv>65
IF vv<123
tt=ss
ENDIF
ELSEIF vv44
IF vv==45
mm=-1
ELSE
nn=nn*10
uu=vv-48
nn=nn+uu
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
GOTO10

C100
PRINT("MOVING TO:",al[0],#13)
PRINT("P",al[0],"V",al[1],"A",al[2],#13)
PRINT("CCS:",tt,#13)
PRINT("TCS:",ss,#13)
PRINT("ICS:",zz,#13)
IF ss==zz
P=al[0]
IF al[1]>0
V=al[1]
ENDIF
IF al[2]>0
A=al[2]
ENDIF
G
ELSE
PRINT("CHECKSUM ERROR, TCS:",ss,"ICS:",zz,#13)
q=104
PRINT("CMD:")
WHILE ab[q]
PRINT("ab[q]")
q=q+1
LOOP
PRINT(#13)
ENDIF
RETURN

C200
PRINT("STAT:")
RS
PRINT(#13)
PRINT("CCS:",tt,#13)
PRINT("TCS:",ss,#13)
PRINT("ICS:",zz,#13)
RETURN

C300
PRINT("ENDING...",#13)
PRINT("CCS:",tt,#13)
PRINT("TCS:",ss,#13)
PRINT("ICS:",zz,#13)
OFF
OCHN(RS2,0,N,9600,1,8,C)
END
RETURN

C400
PRINT("ZEROING",#13)
PRINT("CCS:",tt,#13)
PRINT("TCS:",ss,#13)
PRINT("ICS:",zz,#13)
O=al[0]
RETURN

C500
PRINT("ERROR",#13)
PRINT("CCS:",tt,#13)
PRINT("TCS:",ss,#13)
PRINT("ICS:",zz,#13)
RETURN
END

I don't know how to determine the variables,such as "mm","ss","tt","nn","yy".How to calculate Main Checksum,Command-Only Checksum,Incoming Checksum.
And if i send a message in ASCII, what does the SMART do? How does it store this message?

 
Posted : 04/01/2015 5:41 pm
(@Jimmy)
Posts: 22
Eminent Member Guest
Topic starter
 

Hi,csearcy, I need to use my own PC to communicate with SMART via RS232. I should use Data Model.Unfortunately,I don't understand how to use ASCII talk to SMART. I have no idea about how to send a message in ASCII and how SMART restore this message? Which COMMAND i should use to get this message? I am not sure whether you know me or not. In a word , I want to talk to SMART via RS232 using OMRON PLC serial module. What should I do?

 
Posted : 04/01/2015 5:56 pm
(@mymiaoer)
Posts: 4
New Member Guest
 

Hello csearcy .

I can't make a new topic, so i try to ask you here.

I struggled in 'Historical H/W limit'alarm these days.Our machine is running for more than one year until now.But from last week, it always show 'Historical H/W (positive or negative)limit'alarm in both motors in same machine in turn.About one time in five or six hours.
We already changed both motors,cables,plugs power supply,and even PLC. And made a really good ground. But it always will be there...
We use Port 2 and Port 3 as limits through sensors, then connect them to Port 7. Pin 14,15 for 24V DC supply.Main power is 48V DC.
Could you give me some suggestions for this error? I really don't know why this error comes now.and how to handle it now.

Thank you very much.

 
Posted : 23/05/2015 5:59 am
Share: