Machsupport Forum
Third party software and hardware support forums. => CS-Lab => Topic started by: Chaz on June 30, 2017, 08:12:00 AM
-
So I have a my Denford using an IP-A. The toolchanger macro is basic but can be improved.
The Denford has either an NPN or PNP wired proximity sensor. The logic to work out which way to turn the ATC works but currently I use a 1 sec interval to assume 1 rev of the geared motor. It works but over time it gets out of sync. The best therefore is to count (or decrement) a number based on pulses. Any idea how I do that via a CS Labs input and VB?
Thanks
-
If ((GetInBit(90,0) = 1) and (GetOEMDro(2200) = 0) and (MotorturnCW=1)) then
SetOEMDro(2201) = GetOEMDro(2201) +1
End If
If ((GetInBit(90,0) = 1) and (GetOEMDro(2200) = 0) and (MotorturnCCW=1)) then
SetOEMDro(2201) = GetOEMDro(2201) -1
End If
If (GetInBit(90,0) = 1) then
SetOEMDro(2200) = 1
Else
SetOEMDro(2200) = 0
End If
something like this should work, not tested just written down,
but i think you have to find a criteria to "reference" OemDRO(2200)
Thomas
-
If ((GetInBit(90,0) = 1) and (GetOEMDro(2200) = 0) and (MotorturnCW=1)) then
SetOEMDro(2201) = GetOEMDro(2201) +1
End If
If ((GetInBit(90,0) = 1) and (GetOEMDro(2200) = 0) and (MotorturnCCW=1)) then
SetOEMDro(2201) = GetOEMDro(2201) -1
End If
If (GetInBit(90,0) = 1) then
SetOEMDro(2200) = 1
Else
SetOEMDro(2200) = 0
End If
something like this should work, not tested just written down,
but i think you have to find a criteria to "reference" OemDRO(2200)
Thomas
Many thanks, not sure how that gets figured out but will look at the detail / logic and try and engineer it to work.
-
Hello,
GetInBit(90,0) is your Count Signal
OEMDro(2200) is used to get a raising edge of the Count Signal
MotorturnCW and MotorturnCCW should come from your way calculation of toolchange
OEMDro(2201) ist the Count value.
Thomas
-
Hello,
GetInBit(90,0) is your Count Signal
OEMDro(2200) is used to get a raising edge of the Count Signal
MotorturnCW and MotorturnCCW should come from your way calculation of toolchange
OEMDro(2201) ist the Count value.
Thomas
Thanks, that helps.