Hello Guest it is November 19, 2019, 02:20:33 AM

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 - michael123

Pages: 1 2 »
1
Mach4 General Discussion / Re: variable
« on: July 25, 2018, 05:07:25 AM »
thank you my friend

2
Mach4 General Discussion / Re: variable
« on: July 25, 2018, 02:13:53 AM »
ok thank you

mach 4

can you or sb write code
1-it must work all the time, from the moment the program is started until the program is turned off
2-must read the register
3- multiply by 5, divide by 6
4- save the result to the registry gRegs0/newreg45


In this case

I have an analogue value at the entrance
I want to show this result in a form other than 0-10v


otherwise I will have to interpolate the axes
so I would ask for a script




3
Mach4 General Discussion / Re: variable
« on: July 23, 2018, 08:24:35 AM »
ok, i write to code in edit screen
but how should I run it?
I want it to work all the time

4
Mach4 General Discussion / lua script - outputs, if
« on: July 23, 2018, 06:07:17 AM »
Hi, my program, on button


Quote
local inst = mc.mcGetInstance()
local Output16 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT16)
local Output5 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
local Output12 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT12)

mc.mcSignalSetState(Output16, 1)  --On
mc.mcSignalSetState(Output5, 0)  --Off
mc.mcSignalSetState(Output12, 0)  --Off

 i want to add "if" output 24 csmio ip have 1 then, but i write it (down) and doesnt work, sb could help me?

Quote
if (mc.OSIG_OUTPUT24()==1)then

local inst = mc.mcGetInstance()
local Output16 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT16)
local Output5 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
local Output12 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT12)

mc.mcSignalSetState(Output16, 1)  --On
mc.mcSignalSetState(Output5, 0)  --Off
mc.mcSignalSetState(Output12, 0)  --Off
end



5
Mach4 General Discussion / Re: variable
« on: July 23, 2018, 04:15:20 AM »
and from mcLua

i must save in mach4hobby/ScreenScript or somewhere else ?
i save in mach4hobby/ScreenScript and program (mach4) dont read change

6
Mach4 General Discussion / Re: variable
« on: July 23, 2018, 03:37:04 AM »
thank you very much :)

I wrote this and save, but program dont read it (in view lua script)

Can you help me? :)

7
Mach4 General Discussion / Re: variable
« on: July 19, 2018, 06:25:24 AM »
can you write example code?

for example if i want to read csmio-ip/analog input 1

and multiply by 5
and divide by

and save in gRegs0/newvariable45


I can ask you for it?

and where i must write this code?

8
Mach4 General Discussion / Re: variable
« on: July 18, 2018, 04:33:41 AM »
I want to get "csmio-ip/analog input 0" and do mathematics operation and save in  "new variable"

9
Mach4 General Discussion / variable
« on: July 18, 2018, 04:16:44 AM »
I create new variable
i have register "csmio-ip/analog input 0" and new "new variable"

and i want to do sth mathematic operation, have I write lua sript?

sb can help me?

10
Mach4 General Discussion / Re: lua code help please
« on: July 16, 2018, 08:11:19 AM »
Lua: Error while running chunk

Pages: 1 2 »