Host Engineering Forum
General Category => CTRIO and CTRIO2 => Topic started by: sgsims on April 17, 2014, 12:11:07 PM
-
Since the DL05 can't do Binary Math I am converting the Binary output from the CTRIO to BCD....so far so good. What happens when the binary count from the CTRIO gets out of the BCD range? Will CTRIO will continue to count up to the full range of a binary double word before rolling over to 0? If so I guess I need to figure out a way to soft reset the CTRIO count before it gets above 99999999 or all my math will fall apart.
I guess I should be using the scaling feature of the CTRIO to scale to a BCD format.
-
05 can do some BINARY Math. What exactly do you need?
-
I need to ADD a constant value to the encoder count. So I was trying to use ADDBD
-
Your question got me thinking...I was thinking I needed to use the ADDBD instruction to add a constant to by DWORD Value being mapped from the CTRIO. My constant value is 200 so can I do this?
LDD - V2000
ADDB - Kc8
OUTD - V2002
I tried this using a DL06..don't have a DL05 here in the office. Seems to work.
-
Your question got me thinking...I was thinking I needed to use the ADDBD instruction to add a constant to by DWORD Value being mapped from the CTRIO. My constant value is 200 so can I do this?
LDD - V2000
ADDB - Kc8
OUTD - V2002
I tried this using a DL06..don't have a DL05 here in the office. Seems to work.
EXACTLY!
-
awesome...gotta love those one word positive responses!
Thanks Franji1!