Hello Guest it is April 16, 2024, 01:51:43 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 - Aral

Pages: 1
1
CS-Lab / Re: Csmio-s with Opt laser
« on: May 30, 2021, 05:39:03 AM »
Hi

Yes, currently I am using a CNC adapter with the laser. The 0 to 10v analog output go straight into the adapter for the raster engraving. For vector engraving output 0 of the CSMIO go through a variable resistor to the 0 to 5 volt input of the adaptor. Then I change the intensity of the laser beam manually with the pot and it work nice for me. A volt meter is connected to the 0 to 5 volt input so I can adjust the intensity precise.

2
CS-Lab / Re: Csmio-s with Opt laser
« on: October 23, 2019, 10:16:50 AM »
Hi  Tweakie

Thanks for the speedy reply. The controller's analog output is 0 to 10V PWM, and the digital output is 24V. The laser have 2 inputs. Input one is labeled 5V TTL and input two is just labeled TTL and that one can use PWM to 24V. On the 5V input I connected a 4K2 resistor. That is the only two inputs on the laser. On another controller output I connected a solid state relay for the power supply, and is currently connected on the flood output. If i switch the laser's power supply on it takes about 3 seconds to stabilize. So I cannot use it to switch the laser on with the long delay. If I switch the power supply manually and I use the M62/63 P1 commands to activate the laser everything works perfectly but I can only cut. I know there must be a way to manually set the analog register's value in a M command but I am running in circles. I tried the following code but now I'm stuck.

function M200()
   local inst = mc.mcGetInstance()
    local hreg = mc.mcRegGetHandle(inst, "CSMIO-IP/Analog Output 0");
   regvalue = 5;
   mc.mcRegSetValue(hreg, regvalue)


end

if(mc.mcInEditor() == 1) then
    -- If you are in the mcLua editor, this will cause your script to execute if you Run or Debug
    -- Make sure your Capitalization and numbers match that of the function you are calling
    M200()
end


Any thoughts?

Thanks

Johan
   

3
CS-Lab / Csmio-s with Opt laser
« on: October 23, 2019, 05:28:09 AM »
Hi

I connected the 5v TTL input of the opt laser on the analog 0 output in the controller, and the other TTL input of the laser to digital output 2 of the controller. I can switch the digital pin 2 with the M62/63 commands. But then the laser is switch on on full power. So for cutting it is fine.

Now I am battling to get the PWM working for engraving. I can not get the spindle analog value to work. I went through all the manuals and settings and I think I'm missing something. So now I want to try something different. The idea is to make my own custom mcodes to set the  analog 0 value directly on and off in the macro's, and the I can write my own post processors for the values. But now I am over my head with lua.

I emailed the support at Cslabs but either they do not understand English or do not want to help.

Can somebody maybe help me with the code to set the analog 0 value in the register.



Thanks

Johan

4
Modbus / Arduino and Modbus Help
« on: August 19, 2019, 05:46:20 AM »
Hi

I am totally new to Mach4 and I am struggling with Lua. I connected a Arduino Uno through the Modbus to Mach4. The communication between the Arduino and Mach is ok. On the A0 analog pin is a LM35 Temp sensor. I want to show the temp reading in a text box. In the PLC script I Put the following lines:

-- Temp LM35
inst = mc.mcGetInstance()
hreg = mc.mcRegGetHandle (inst,"Arduino/LM35")
local TempVar = mc.mcRegGetValueString(hreg)
local TempValue = tonumber(TempVar)*500/1023

How do I get the Tempvalue in the textbox register?

Sorry if it is a dumb question.

Thanks

Johan

Pages: 1