Teensy and Modbus

This Section is for users to discuss hardware

Teensy and Modbus

Postby limited660 » Tue Jul 17, 2018 10:53 pm

Has anyone been able to get the code from http://www.machsupport.com/forum/index. ... 105.0.html working on a Teensy? I've set it up on an Uno and anything set as an input shows up as a 1 on the variables table and I'm able to toggle them to 0 by grounding that input but when I load the code on the Teensy, none of the variables toggle or start as a 1. I've tried changing Freq to match the 48MHz of the Teensy and still nothing.
limited660
 
Posts: 11
Joined: Mon Jun 25, 2018 1:13 pm

Re: Teensy and Modbus

Postby Robertspark » Wed Jul 18, 2018 3:09 pm

Which Teensy? There are a few of them?
Also are you installed the Teensyduino addon: https://www.pjrc.com/teensy/teensyduino.html

This is the point that I say that I don't use the arduino IDE any more as you can do things much faster without any syntax errors by graphically programming arduino type boards using Visuino. and if you install Visuino Pro (no extra cost) you can use modbus functionality.
https://www.visuino.com/

Visuino Pro is installed from the Google+ Community

There are a few detailed Visuino + Modbus youtube clips here:
https://www.google.co.uk/search?q=modbu ... 23&bih=408


Visuino costs ~USD $10 which includes 3 months of updates, if you pay another £10, you'll get an additional 12 months of updates, hence the annual cost is ~$10
Visuino Pro will cost more at some point in the future, but at present it is "free" with a standard Visuino licence. (There was talk of a lot of other pro features being added before a separate price is added for the Pro version {such as CANBUS and other features}

You can use Visuino free for a month too.... that should be long enough for you to programme 1 board as an modbus slave.

If you need help let me know and I'll try to help with it.
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2106, Neuron Lite
UCCNC v1.2105 Macro Manual
Robertspark
 
Posts: 985
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: Teensy and Modbus

Postby limited660 » Wed Jul 18, 2018 7:35 pm

I've been trying on the Teensy LC, it compiles and installs fine and I can see register 50 which is the timer updating but none of the inputs appear to work. When I do the same thing with the Uno, all of the inputs show up as 1 and then change to a 0 when grounded. I've tried tying the input to ground and 3.3v on the Teensy and still nothing, I'm sure its something in the code not recognizing the pins correctly and setting them but I don't really understand how it works yet. I'll give Visuino a try to see if I can get that working. I would like to stay with actual code so I can eventually merge it with my THC - https://www.cnczone.com/forums/general- ... ntrol.html
limited660
 
Posts: 11
Joined: Mon Jun 25, 2018 1:13 pm

Re: Teensy and Modbus

Postby Robertspark » Wed Jul 18, 2018 7:42 pm

Thanks for the link to the thread, looks very interesting
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2106, Neuron Lite
UCCNC v1.2105 Macro Manual
Robertspark
 
Posts: 985
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: Teensy and Modbus

Postby Battwell » Wed Aug 08, 2018 8:58 am

im using the basis of that code (slightly modified) running 2 arduinos (megas) it works perfectly on those.
im adding a button control panel to my machine- and using the arduino for all the button/led confirmation i/o
i got it all going over a year ago. one of the arduinos has been communicating with my office pc and uccnc since then- and never failed.
sorry- not tried the teensy.
https://www.youtube.com/watch?v=7-T4hNrYVa4
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 374
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk


Return to Hardware

Who is online

Users browsing this forum: No registered users and 2 guests