PLUS+1 User Forum

PLUS+1 Hardware => Controllers => Topic started by: skh69nova on January 16, 2017, 07:03:52 PM

Title: Controller as IO Module
Post by: skh69nova 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
Title: Re: Controller as IO Module
Post by: Marbek_Elektronik 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.
Title: Re: Controller as IO Module
Post by: oiltronic 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.