Hello Guest it is May 17, 2021, 05:43:58 PM

Author Topic: input output  (Read 902 times)

0 Members and 1 Guest are viewing this topic.

input output
« on: August 18, 2018, 06:44:54 PM »
hi
can some one help me with this point?
i need wait to signal from extrnal boton ,and until the signal arive  ,i need  one light(output) will blink
how can manage this in m function?
thanks
Re: input output
« Reply #1 on: August 18, 2018, 07:40:01 PM »
Hi,
there is two parts to your question.

Lets take one part.....the blinking button.

If you go to Screen Edit mode along the top you will find the Toggle Button. It allows you to put a toggling button on your screen in a position
of your liking.

I have attached I picuture of the properties of the Enable button, which is just an example of the Toggle Button, and you can see how to assign colors,
blink rate and also that you can attach the button to an input to Mach.

We can worry about attaching an input a bit later. May I suggest that you experiment by adding a toggle button to your screen and setting its features.

Are you using one of the standard screensets? If you are by adding a button you are modifying the standard issue screeset. That's fine but in a months
or twos time you'll download the newest, latest and greatest Mach4 build that standard screenset will be overwritten, along with your button. You'll have to redo
all those tweaks and additions you made. A real PITA.

To avoid that go to the screenset folder of Mach4 and make a personalized copy of your favorite standard screenset. Use that screenset in your profile and
then any tweaks and modifications you make will not be overwritten when you update Mach.

If this doesn't make sense then don't worry about it. I promise you it will make sense when you update only to find that your screen doesn't work as it used
to.

Craig
My wife left with my best friend...
     and I miss him!
Re: input output
« Reply #2 on: August 18, 2018, 10:34:49 PM »
hi ,thanks alot for yours fast reaplay
but i mean for "real" light  ===>>> output
because i have remote  control with "real" butons and lights
and this buton shuld blink
thanks
yaakov
Re: input output
« Reply #3 on: August 18, 2018, 10:45:33 PM »
to be clear ,i mean in Lua script ,to activate output blinking
Re: input output
« Reply #4 on: August 18, 2018, 10:56:57 PM »
Hi,
OK, that's easy......put a blinking LED on screen, and connect the LED to an input to activate it and connect to an output
so that you can wire the light in your physical button.

Note that if you don't want the LED on screen you can just make it invisible, but its still there. Using the LED code built into the GUI
means that you don't have to write any LUA code.

Craig
My wife left with my best friend...
     and I miss him!
Re: input output
« Reply #5 on: August 18, 2018, 11:54:29 PM »
Thanks
If in that way i need 2 more question,first how change the blinkung timing( its have 2 typs ,slow and fast ,each habe onthere meaning) second how i control this light from lua script( this light need work only in specific terms that cheack in M function
Thanks
Yaakov
Re: input output
« Reply #6 on: August 19, 2018, 12:17:49 AM »
Hi,
to my knowledge its not possible to alter the blink rate on the fly. I think its fixed....see the attached pic.

If you use this LED scheme it is activated by a signal of your choice, for instance ISIG_INPUT15. If you control that input by
a combination of external signals and/or Lua logic you can control the LED.

Craig
My wife left with my best friend...
     and I miss him!
Re: input output
« Reply #7 on: August 19, 2018, 05:05:40 PM »
hi
thanks
i try but its not actvate the output
Re: input output
« Reply #8 on: August 20, 2018, 03:12:09 PM »
Hi,
OK, I think I have misunderstood the 'connect to an output'. I was expecting the nominated output would reflect the state of the LED.
After some experimenting I realize I'm wrong. It means that the LED reflects the state of the output, thus if OSIG_OUTPUT15 is high and it
connects to the coolant pump say, then the LED turns on when the coolant pump turns on, not the coolant pump turns on because the
LED turns on.

As I have suggested it the LED is connected to two sources, an input ISG_INPUTnnn AND  an output OSIG_OUTPUTnnn. This is a mistake,
if the input and output states differ what does the LED do?

I think this will require some Lua code. The advantage of the idea I promoted (wrongly) was that you didn't have to write any code. I now realize that
is not going to work. Have a look at some od Daz-the-Gaz videos, there is one about using a timer. You could take advantage of that. I will give it some more thought
and report back.

Craig

My wife left with my best friend...
     and I miss him!
Re: input output
« Reply #9 on: August 20, 2018, 11:42:49 PM »
hi thanks alot
at least i did it in  primitive way ( with loop)

i attach the file
thanks alot any way