Hello Guest it is March 29, 2024, 12:58:12 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 - Illya

Pages: 1
1
Mach4 General Discussion / Re: Mach4 Lua Script examples
« on: May 09, 2014, 09:20:58 PM »
Oh I got ya now, thanks again
I was toggling the led but not the modbus output



yes it takes time to get your head around it I still have a lot of scripts to try to figure out to get the machine running the way I would like .... But it can be done (allot of trial and error mostly error for me ;) )

actual script from buttons on my screen set ...this does work!!

--OUTPUT 5
--Get the instance of the controller
local inst= mc.mcGetInstance();
--Get the out5 handle
local out5= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5);
--Output TOGGLE
 local outstate = mc.mcSignalGetState(out5);
 if (outstate == 1) then
   mc.mcSignalSetState(out5, false);
 else
   mc.mcSignalSetState(out5, true);
 end



--OUTPUT 8
--Get the instance of the controller
local inst= mc.mcGetInstance();
--Get the out8 handle
local out8= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT8);
--Output TOGGLE
 local outstate = mc.mcSignalGetState(out8);
 if (outstate == 1) then
   mc.mcSignalSetState(out8, false);
 else
   mc.mcSignalSetState(out8, true);
 end

2
Mach4 General Discussion / Re: Screen Set Ideas
« on: May 09, 2014, 07:37:34 PM »
Got this idea from a great screen Illya created for his Modbus GUI interface  ;)

Made this to be a little more PLC Generic

Labels can be edited to suit future development.


I use the following lua script to toggle output buttons great for diagnostics to test if they work :)

http://www.machsupport.com/forum/index.php/topic,27199.msg191959.html#msg191959

3
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 09, 2014, 11:10:39 AM »

This is odd. The 485 box is permanently checked on the version I have. I was thinking that might be the issue. Like somebody was waiting for an RTS or CTS or something like that. A deadly embrace kind of thing.
[/quote]

Yes the tick does show up on mine as well. It seems to come up after you setup and saved the modbus device.It has not had an effect on mine.

4
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 09, 2014, 10:55:36 AM »
No I only have two PLC's running. The post with three screen shots was from the notebook which I use to play around with the setup.

5
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 09, 2014, 10:53:00 AM »
screen shot from the machine computer Modbus works well on it

6
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 09, 2014, 09:26:16 AM »
Steve

These are the screen shots of the setup for my modbus using a AB PLC. :)

Illya

7
Mach4 General Discussion / Mach4 Lua Script examples
« on: May 08, 2014, 10:24:07 PM »
This is my attempt at an output button toggle script (hopefully it is safe enough) for eg. output 2.
Works for me. :)
 
  See later post for corrected code.

8
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 08, 2014, 09:35:44 PM »
Hi Simpson
What device are you trying to connect to Modbus?
If you post a little more info I can try and help :)
I have 2 Allen Bradley Micrologix 1200 PLC's connect via 2 x RS232 connections
48 inputs 40 outputs

Illya

Pages: 1