Hello Guest it is June 25, 2019, 08:48:22 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.


Messages - ScottL

Pages: 1
1
Mach4 General Discussion / Re: Event Script for Enable Button
« on: May 04, 2016, 09:29:41 AM »
bob,

we are going to test your code shortly, but i wanted to ask why should the code be placed into the screen load script in the signal library section rather than the event script section?

i should note that while i have done lua programming before, i am an extreme noob with regards to mach4. yesterday was my first day to read up on any of it. so my questions come from a desire to learn more.

2
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