Hello Guest it is March 29, 2024, 03:51:36 AM

Author Topic: Output Issue  (Read 4984 times)

0 Members and 1 Guest are viewing this topic.

Offline pofo

*
  •  55 55
    • View Profile
Output Issue
« on: June 26, 2011, 12:25:04 PM »

I posted a similar thread in the general forum. But now I'm wondering if this is a DSPMC issue.

I have 4 buttons defined for outputs. I have VB code written (thanks Hood) to control the output. I execute the script. The output toggles High-Low-High for  about 100ms. It does not stay in the low state as desired. Any ideas why it is doing this?

Output 3, Mach3 port 1-6, DSPMC J4-17
Output 4, Mach3 port 1-1, DSPMC J4-2
Output 5, Mach3 port 1-0, DSPMC J4-14
Output 6, Mach3 port 1-4, DSPMC J4-16
Re: Output Issue
« Reply #1 on: June 26, 2011, 02:53:01 PM »
mach3 update rate is 10Hz (100ms period), so the outputs cannot toggle faster than that.  if you want more precise timing control of I/O,  you can use the dspMacro feature.  

e.g. the following dspMacro code turns on output 17 for 25 millisec

SetDSPData( 40+17, 1 )  :REM turn on output 17

StartTimer(0, 25) :REM Start Timer 0 for 25 mSec

2010
if TimerDone(0) = 0 then goto 2010 :Rem Wait for Timer 0 to get Done

SetDSPData( 40+17, 0 )  :REM turn off output 17


the dspMacro runs inside the DSPMC controller.  there are some DROs and LED that are shared between mach3 and DSPMC, and are used to command the dspMacro and move information back and forth.   If you like to explore this option, let me know your email and I will send you more info and other files needed.

rgds
Rufi

Offline pofo

*
  •  55 55
    • View Profile
Re: Output Issue
« Reply #2 on: June 26, 2011, 03:34:09 PM »

Thanks Rufi,

I don't want finer control. I want the output to change state and remain there, rather than toggle. Perhaps I don't understand how outputs work. I put this line in the Mach3 VB script for the button:

ActivateSignal(OutPutx) - where x is the number of the output. I see the output toggle Low-high-low. I just want it to go from low to high and remain there until I hit a different button that sends  DeActiveSignal(OutPutx). What do I need to do?

Re: Output Issue
« Reply #3 on: June 26, 2011, 04:35:28 PM »
are you sure this output is not controlled by mach3 also?  you can look at the debug window and see a message like: Outputs Changed to xyz,  where xyz is the 32 bit hex value for the 32 outputs on the DSPMC.  it will tell you what mach3 is trying to do on the outputs.  hope this will help.

-rufi

Offline pofo

*
  •  55 55
    • View Profile
Re: Output Issue
« Reply #4 on: June 28, 2011, 12:55:09 AM »

Ok, thanks. I will look further into this.