Which Teensy? There are a few of them?
Also are you installed the Teensyduino addon:
https://www.pjrc.com/teensy/teensyduino.htmlThis 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=408Visuino 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.