Author Topic: Controller as IO Module  (Read 8785 times)

skh69nova

  • Guest
Controller as IO Module
« on: January 16, 2017, 07:03:52 PM »
Is anyone aware of a way to make a controller act as an IO module without developing custom can messages.

We would like to keep all of our logic on one controller but the existing IO modules don't offer the pin configurations needed but a secondary controller would work.

Thanks

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 352
  • Karma: +8/-0
    • Marbek Elektronik
Re: Controller as IO Module
« Reply #1 on: January 18, 2017, 09:16:34 AM »
You can't implement the new controller in your software, as you have done with an io-module.
You have to build an communication between them:
For example, send alle outputs on 0x401 and read all inputs on 0x402 via CAN-messages.
In your new controller you read this messages and give it to output and read input and send via CAN to your master-controller.
It is easy.
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung

Offline oiltronic

  • PLUS+1 Guru
  • *****
  • Posts: 170
  • Karma: +15/-0
Re: Controller as IO Module
« Reply #2 on: January 21, 2017, 07:00:47 AM »
I'm not aware of anything.  It would be nice if Danfoss made a hex or application file for converting a microcontroller over to a generic i/o module, complete with a matching template to drop into the main application.  There would be more setup required for configuring all the i/o pins but that could be done with a service tool application.  Some things, like pulse or count inputs, just couldn't be sent over CAN without data loss so would require special intermediate code on the new i/o module to process the signals into a format (such as frequency, speed, or total count) that could be send periodically over CAN.

Since this doesn't exist yet I've made extremely generic applications for the MC050 and MC088 controllers to collect the inputs and send them out over CAN, and to likewise receive outputs.  PWM outputs are done by receiving parameters like speed, direction, and ramp time so the i/o module handles the actual ramping.  Loss of communications sets all outputs to safe default values.  I also use an input pin or two for setting the CAN address, so that multiple i/o modules can exist on the same bus with identical application code and parameters, which is much easier for maintenance.