111
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 25, 2011, 06:02:47 PM »
Hi Peter,
I'm stuck at the point of referencing registers from Cubloc. My test code in Cubloc is:
Do
If _D(66) = 1 Then
High 40
End If
If _D(66) = 0 Then
Low 40
End If
Loop
Basically, turning on a relay when holding register 66 is set to 1. When I manually change holding register 66 through Test ModBus, the relay is set. However, when I use the following VBA code in Mach3:
Call SetModOutput (66,1)
The relay is not set- it seems like it's referencing a different register. My AutoPolling Options are set with Input Start Addresses of 1025 and 1536, and Output Start Address is 2048. I'm using this setup based on someone's post who had a similar project, but I have no idea what it means. Could you explain how the Start Addresses are used?
Do you have any idea where I'm going wrong?
Thanks,
Nate
I'm stuck at the point of referencing registers from Cubloc. My test code in Cubloc is:
Do
If _D(66) = 1 Then
High 40
End If
If _D(66) = 0 Then
Low 40
End If
Loop
Basically, turning on a relay when holding register 66 is set to 1. When I manually change holding register 66 through Test ModBus, the relay is set. However, when I use the following VBA code in Mach3:
Call SetModOutput (66,1)
The relay is not set- it seems like it's referencing a different register. My AutoPolling Options are set with Input Start Addresses of 1025 and 1536, and Output Start Address is 2048. I'm using this setup based on someone's post who had a similar project, but I have no idea what it means. Could you explain how the Start Addresses are used?
Do you have any idea where I'm going wrong?
Thanks,
Nate