Direct soft 5 math help please

Brad750

Member
Join Date
May 2015
Location
Indiana
Posts
6
Hello all,
I am trying to synchronize the speed of two motors so that once an operator sets them both where they want they can push a button that syncs them. Thus giving them one place to change the speed of the entire machine and both will follow at the same ratio they were when the sync button was pushed. The HMI input is 0-100 in BCD. So for example if motor A is at 100 and motor B is at 75 then the ratio would be 0.75. So I wrote some code to do the math and store that ratio, then multiply that ratio by the main motors set speed constantly. The problem is it doesn't work. I can not get this software to do anything with decimal points involved. I tried using non decimal numbers and it follows correctly. So any help would be appreciated.

c43 is in there to stop that rung from functioning during testing. V4200 gets zero loaded into it every time

Thank you.

Untitled.jpg
 
Can't find the program i did this in, but I had to MUL by 1000 first, do my other math, then DIV by 1000. The value to the right had to be POPed out of the acc I think.
Call AD tech support free and good, also they have a forum too
 
It would have been nice if you would have labeled the V registers but here is my analysis -

In rung 9 it appears that you have Double BCD values in V2206/V2207 and in V2200/V2201. You are converting each by using BIN then BTOR to store REAL values in V4000/V4001 and V4002/V4003. You are then dividing the value in V4000/V4001 by the value in V4002/V4003 giving a REAL ratio in V4200/V4201.

In rung 10 it appears that you are trying to MULtiply the Double BCD value in V2200/V2201 by the REAL value in V4200/V4201. You are storing the result in V2206/V2207. This operation on two different number types is almost always doomed to failure.

Please check my analysis with what you understand and re-post.
 
It would have been nice if you would have labeled the V registers but here is my analysis -

In rung 9 it appears that you have Double BCD values in V2206/V2207(Motor A Input from HMI in BCD and in V2200/V2201 Motor B Input from HMI in BCD. You are converting each by using BIN then BTOR to store REAL values in V4000/V4001 and V4002/V4003. You are then dividing the value in V4000/V4001 by the value in V4002/V4003 giving a REAL ratio in V4200/V4201.Here I get zero

In rung 10 it appears that you are trying to MULtiply the Double BCD value in V2200/V2201 by the REAL value in V4200/V4201. You are storing the result in V2206/V2207. This operation on two different number types is almost always doomed to failure.

Please check my analysis with what you understand and re-post.

Thank you for your input and Yes you are correct. That is why I placed the C43 in rung 10 to block it from functioning until I get rung 9 to work correctly. My problem lies with the V4200 double. I get zero in it regardless. I'm sorry that I did not label these Please see my comments above in red for documentation.
 
Are the two double word locations after conversion holding the equivalent REAL versions of the double BCD values received from the HMI.

When viewing​ the result of the division are you viewing it as a REAL?

Probably not anything but are you actually triggering the math in rung 9 since you have an edge triggered contact.
 

Similar Topics

I have written one program with FDB. Thought I could therefor write code for an automation direct DL-06. Huge learning curve. I believe I have...
Replies
3
Views
1,760
Hey All, I got an older piece of equipment here, controls done with an Automation Direct 06 plc (OEM is long gone). I'm trying to piece together...
Replies
11
Views
2,377
Hello everyone, I have a customer that needs some help and I dont really understand the question so im posting it here, I think he is over...
Replies
16
Views
3,962
I am working with a DL 205, DL250-1 CPU, D2-16ND3-2 Digital input module. I am writing a ladder that will send the value from the digital input...
Replies
0
Views
1,230
Hello! Some brief information: I am working with a DL205 and a DL250-1 CPU with an ECOM100 Module. My project requires for me to read a register...
Replies
5
Views
2,160
Back
Top Bottom