Hello Guest it is November 20, 2019, 10:32:04 PM

Author Topic: CS w/Brains & Triggers  (Read 10433 times)

0 Members and 1 Guest are viewing this topic.

Re: CS w/Brains & Triggers
« Reply #20 on: November 17, 2013, 11:40:40 AM »
I cannot get ANY CS input to OEM trigger anything (macro).

I think I need a very clear, simple example of where I can activate input 1 on the CS, and have IT execute a simple macro.

Thanks, off to chores now.
Russ

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: CS w/Brains & Triggers
« Reply #21 on: November 17, 2013, 11:50:50 AM »
Ok Russ,
 what I would do is use the macropump, as an example here is some stuff I do in the macropump.

Ref= GetInbit(100,6)
GoZ10=GetInBit(100,8)
GoZero=GetInBit(100,7)
Clamp=GetInBit(100,10)



  If Ref=1 Then
   DoOEMButton(1024)
   While IsMoving()
   Wend
   DoOEMButton(1023)
   While IsMoving()
   Wend
   DoOEMButton(1022)
   While IsMoving()
   Wend
   
  End If
 
 
 If Clamp=1 Then
  SetModOutput(0,1)
 Else
  SetModOutput(0,0)
 End If
 
 
 If GoZ10=1 Then
  Code"G0Z10"
  End If
 
If GoZero=1 Then
  DoOEMButton(1017)
  While IsMoving()
  Wend
  End If 

In the above example I am using an extra I/O module so the modbus address will be different, if I recall the address of the base unit is 99 but best check on that. Also note that in the "clamp" part that is me sending a signal out to my PLC over serial Modbus and it is not how you would call an output via CSMIO Modbus, you would have to check the CSMIO manual for that.


Hood
« Last Edit: November 17, 2013, 12:04:05 PM by Hood »
Re: CS w/Brains & Triggers
« Reply #22 on: November 17, 2013, 12:18:57 PM »
modbus is new for me.
I'll study a bit on it.
So ...
Will have:
CSMIO-M  inputs 1,2,3 or 4 start the script in the pump that contains ....
If 1, then ******
If 2, then ********
If 3, then ********
If 4, then *******

Is it that simple ?

Thanks
                                         

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: CS w/Brains & Triggers
« Reply #23 on: November 17, 2013, 12:47:24 PM »
Not quite that simple Russ,,

I dont really know what things are called and what connections you have but maybe something like the following in your macropump (remember you need to enable macropump and restart Mach for it to load)


Russ1 = GetInBit(99,1)  ' this just sets a friendly name for the input, the input is the modbus address of the device in question and the bit number. The bit number equates to the input number so if using input 0 it would be 0 etc
Russ2 = GetInBit(99,2)
Russ3 = GetInBit(99,3)
Russ4 = GetInBit(99,4)


If Russ1=1 Then
WHATEVER YOU WANT TO HAPPEN GOES HERE
End If

If Russ2= 1 Then
 etc etc etc

As I said earlier I am not sure of the actual address that your IP-M base unit will be, I have put 99 above but that may not be correct. I think if you go to Plugin menu at the top right of Mach then click on the CSMIO entry there, you might see the modbus address.

Also note if using this method you MUST disable the OEM triggers as having any of the Ports and Pins set up to use the same values as the CSMIO Modbus I/O will make nothing work.


Hood
Re: CS w/Brains & Triggers
« Reply #24 on: November 17, 2013, 08:12:19 PM »
That looks doable Hood, thanks.
I don't see any info anywhere regarding the CS-M ModBus address. ... or what com port to use. or if it's even available  ? ?

Going through Art's video again. kinda confusing.
Regards,
Russ
Re: CS w/Brains & Triggers
« Reply #25 on: November 17, 2013, 11:04:03 PM »
Wondering about using ModBus directly to and from the PLC instead ? ? ? Make any sense ? ? ?
Still studying, don't see anything ModBus at the CSMIO ...... yet.
Thanks Hood,
Russ

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: CS w/Brains & Triggers
« Reply #26 on: November 18, 2013, 02:50:23 AM »
Russ, the Extra I/O modules manual gives good info regarding the calls you can make with the CSMIO and it also tells you how to work out the address for each module, not the base unit however..
I am not at the workshop yet but if I recall you can go to Plugin Control menu then to CSMIO. In the window that opens there should be a tab with something like Expansion Modules, click that and I think it will give you a list of all modules (inclucding base unit) and it should have the address there. I will confirm whether my memory is correct or not when I get to the workshop.

Modbus via PLC is also easy enough, or rather I should say the way I do it is easy for me ;D
I just use the old serial interface, not the plugin.
Hood

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: CS w/Brains & Triggers
« Reply #27 on: November 18, 2013, 04:57:31 AM »
Well just looked and the address is not there so cant remember where I saw it, I will have a search through the manuals and see if I can find it.
Hood

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: CS w/Brains & Triggers
« Reply #28 on: November 18, 2013, 05:20:50 AM »
Ok Russ, decided to just go to the wee lathe and disable the limit switch (in ports and pins, so it wouldnt conflict) then write some VB to look at it so I could figure out the address.
It has an IP-S on it but I think it will be the same address for all models base units.
Anyway what I had was

If GetInBit(90,7) Then  ' This is the input I am using for X limit
MsgBox"Switch Closed"
Else
MsgBox"Switch Open"
End If


It worked fine so the address is 90 :) The pin will be whichever you are connected to, starting from 0.
Hood
« Last Edit: November 18, 2013, 05:35:09 AM by Hood »
Re: CS w/Brains & Triggers
« Reply #29 on: November 18, 2013, 08:32:09 PM »
Hey Hood, thanks !

Got that part working well.

Thought there was more to setting it up than that.

Good job, thanks again,
Russ