Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 08:47:50 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
General Mach Discussion
Mapping modbus to PLC
Pages:
1
Go Down
« previous
next »
Author
Topic: Mapping modbus to PLC (Read 574 times)
0 Members and 2 Guests are viewing this topic.
rrc1962
Active Member
Offline
Posts: 434
Mapping modbus to PLC
«
on:
December 19, 2010, 01:09:10 PM »
I'm having a time getting my head wrapped around this. I'm working with a DL05 and have a program running on the PLC. It responds as it should to switch X inputs and triggers Y outputs. Just to get something up and running quickly, to communicate with mach, I energize a Y output which puts 5V on a mach PP pin. Mach sees this and does it's thing. The PLC also has 4 analog inputs for doing various things. One comes from my plasma voltage divider so that one has to be a analog input, but the other three are just for setting parameters. These parameters could be set on a mach screen and written to the PLC V memory via modbus. My analog input is binary, so when I write a value (a number between 0 and 50) in needs to be in binary.
I guess my issue is that I'm lost when it comes to modbus addressing. All I know for sure through trial and error with the modbus monitor is that 1024 - 1028 are my 4 analog inputs. I can see X inputs at 2048 but only if I select "Discrete Inputs" and specify 8 inputs in the monitor. I can see all 8 switch no problem. If I select "Input Registers" I see nothing, just zeros.
What I would like to do is pick a V memory range on the PLC and use that for bit input/output. For instance, use V2200 for X inputs and V2201 for Y outputs. X0 = V2200.0, X1 = V2200.1......X7 = V2200.7. Same thing for V2201. So my PLC program wanted to notify mach of an event, it, for instance, would set V2201 bit 0. Mach would then need to see this....and this is where I'm running in circles.
I've gone through the PLC manual but it's pretty vague when it comes to modbus addressing, and the examples they give don't seem to make sense. Could someone please give me a rundown on how the modbus maps to V memory locations on the PLC?
Thanks
Logged
rrc1962
Active Member
Offline
Posts: 434
Re: Mapping modbus to PLC
«
Reply #1 on:
December 19, 2010, 05:35:22 PM »
I'm making headway. I think I've figured out how to map a specific V memory address to the modbus. I tested setting bits both ways and it seems to be working. The question I have now is how to send actual data, like the number 50 and have it formatted in binary in the PLC so the program can use it. Do you convert the number in VB then send it using SetModOutput()? I know that's how you set a bit, but will it also work for sending a word?
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Mapping modbus to PLC
«
Reply #2 on:
December 19, 2010, 09:12:37 PM »
look, in the "Members docs" and look for the Brains users guide, it goes into detail on doing Modbus with ADC plcs.....
you can send the value in decimal in mach3, and then convert or not, in the pLC, the pLC has many ways to do data conversion types.....
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
rrc1962
Active Member
Offline
Posts: 434
Re: Mapping modbus to PLC
«
Reply #3 on:
December 19, 2010, 11:24:40 PM »
I've pretty much been through all the vids and docs. I'm real close. I've got everything working in NP modbus. I can assign inputs and outputs in ports and pins and everything works. I can set modbus data in VB, but the only thin I can't get working is brains. I may be using the wrong address. I used the same address specified in the modbus setup, which didn't work. Then I tried the PLC address (1500) and that didn't work. Seems the one only thing it will accept in a small integer. It accepts 0 and 1 as address but neither work. What am I doing wrong?
SC96.jpg
(33.57 KB, 454x441 - viewed 47 times.)
Logged
rrc1962
Active Member
Offline
Posts: 434
Re: Mapping modbus to PLC
«
Reply #4 on:
December 19, 2010, 11:42:41 PM »
I got it. The address is the pin number. 0 - 63. Working great now.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Mapping modbus to PLC
«
Reply #5 on:
December 20, 2010, 08:07:41 AM »
in the member docs area, the "Brains users guide" goes into that stuff.....
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
rrc1962
Active Member
Offline
Posts: 434
Re: Mapping modbus to PLC
«
Reply #6 on:
December 20, 2010, 02:48:47 PM »
I see a conversion instruction for going from BCD to binary. The PLC only seems to be able to go between BDC and binary, unless there are some more conversion instructions that I'm not seeing. Could you explain how you would do a decimal to binary conversion in a DL05?
Thanks
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Mapping modbus to PLC
«
Reply #7 on:
December 20, 2010, 05:54:53 PM »
your making it FAR more complex than it needs to be, open and use Windows Calculator in scientific mode. it has numbering system converters, i.e tick the binary button and put in the binary equivelant of 50, or start at 50 in decimal, and thne convert to binary......
All numbers are really binary, in a PLC or PC anyway, so your just changing how it is presented to the user or manipulation filters.......
ADC has a "Decimal" data type, use that for your numbers, and just keep what the binary is doing in your head, OR, you can use the DATA VIEW window and look at, and change the data view type......
for example if you have a 12 bit number, then its max in decimal would be 4096, or 0-4095 in computer talk.
50 decimal, in binary would be: 110010 (using win calculator).
So, in Mach3 if I send a DECIMAL 50 across the modbus, into a User VARIABLE address in the PLC, the PLC sees the 50 as a Binary number, you DONT have to do anything to it.......
scott
«
Last Edit: December 20, 2010, 05:58:53 PM by poppabear
»
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
rrc1962
Active Member
Offline
Posts: 434
Re: Mapping modbus to PLC
«
Reply #8 on:
December 20, 2010, 06:10:20 PM »
I did notice that in data view the scale of the analog input is 0 - 4095. So lets say I have the pot about half way and I have 2000 sitting in VMemory. If I write 2000 from Mach to another VMemory address, the PLC will see the two as equal, correct?
Logged
rrc1962
Active Member
Offline
Posts: 434
Re: Mapping modbus to PLC
«
Reply #9 on:
December 20, 2010, 11:13:59 PM »
I ended up scaling the data in mach the same as it is scaled in the PLC. I made a slider with a scale of 0 - 4095. The upper range of the slider = 10V. I wrote a brain formula to convert the scaled digital data to analog and show that in a separate DRO. Another brain writes the slider DRO to the modbus.
Thanks for the help. Your explanation helped me get it straight in my head.
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...