Hello Guest it is April 19, 2024, 01:04:15 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ScottL

Pages: 1
1
Mach4 General Discussion / Event Script for Enable Button
« on: May 03, 2016, 04:18:34 PM »
I have an DSPMC that I'm trying to script a button that will toggle Enable.

Here is the code I am trying per the Mach4 Core API, but it fails to compile...any help would be appreciated:
Code: [Select]
-- Enable button
if (sig == mc.ISIG_INPUT4) and (state == 1) then
    MINSTANCE mInst = 0;
    int rc = mcCntlEnable(mInst, TRUE);
end

I had also tried the following code from the Scripting Manual which gave an error about the second parameter, which is why I moved onto the API syntax:
Code: [Select]
-- Enable button
if (sig == mc.ISIG_INPUT4) and (state == 1) then
    local inst = mc.mcGetInstance()
    mc.mcCntlEnable(inst)
end

Pages: 1