Author Topic: IOR5E relay and LED routines - code offered...  (Read 12322 times)

steves

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
IOR5E relay and LED routines - code offered...
« on: February 04, 2006, 07:19:12 AM »
I've made an ior5e task module for anyone who wants it. Code is in the attached zipfile, along with a skeleton example of how to use it.

The code uses a union declared as follows:
Code: [Select]
typedef union _IOR5E
{
struct
{
unsigned int ledPWR : 1;
unsigned int ledRLY1 : 1;
unsigned int ledRLY4 : 1;
unsigned int ledRLY2 : 1;
unsigned int ledRLY5 : 1;
unsigned int ledRLY3 : 1;
unsigned int ledIN4 : 1;
unsigned int ledIN1 : 1;

unsigned int ledIN5 : 1;
unsigned int ledIN2 : 1;
unsigned int ledIN6 : 1;
unsigned int ledIN3 : 1;
unsigned int ledOPTO3 : 1;
unsigned int ledOPTO1 : 1;
unsigned int ledOPTO4 : 1;
unsigned int ledOPTO2 : 1;
unsigned int rly1 : 1;
unsigned int rly2 : 1;
unsigned int rly3 : 1;
unsigned int rly4 : 1;
unsigned int rly5 : 1;
unsigned int unused1 : 1;
unsigned int unused2 : 1;
unsigned int unused3 : 1;
} bits;
unsigned short long Val;
unsigned char bytes[3];
} ;

extern union _IOR5E ior5e;


Each led and relay is labelled as per the legend on the panel supplied with the IOR5E.

To switch off the LED labelled OPTO 2, for example, just write:

Code: [Select]
ior5e.bits.ledOPTO2 = 0;
I should add that it is based heavily on the example code provided by David.

Hope someone finds it useful.

Steve S


« Last Edit: November 15, 2011, 05:07:56 PM by modtro2 »

Bob_H

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #1 on: February 06, 2006, 05:20:25 PM »
Thanks

jaa

  • Full Member
  • ***
  • Posts: 16
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #2 on: February 16, 2006, 06:13:47 PM »
Dear Steve,

It seems to be useful, and for sure I will try to us it.  It also will be nice for me to have the David code, could you provide me with it? Thanks a lot.
Br

Jaa
« Last Edit: November 15, 2011, 05:02:35 PM by modtro2 »

steves

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #3 on: February 17, 2006, 01:17:20 AM »
Sure , Jaa, it's right here:

http://forum.modtronix.com/index.php?topic=126.0

Steve S

jaa

  • Full Member
  • ***
  • Posts: 16
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #4 on: February 20, 2006, 06:41:27 PM »
Hello Steve,

I added  ior5e.h in the header files, as well as  ior5etask.c in the source files of my mpmxwebee.mcp
The following error arrives when I build.

Executing: "C:\MCC18\bin\mcc18.exe" -p=18F6680  /i".." /i"c:\mcc18\h" /i".\src" /i".\mxmctcpip" "ior5etask.c" -fo="ior5etask.o" -sco
C:\mp730b_full\ior5e\web65203\src\ior5etask.c:30:Error [1027] unable to locate 'projdefs.h'


Any idea?

Br
Jaa

Administrator

  • Hero Member
  • *****
  • Posts: 171
    • View Profile
    • http://www.modtronix.com
Re: IOR5E relay and LED routines - code offered...
« Reply #5 on: February 20, 2006, 11:33:16 PM »
Hello Jaa

What version of the source code do you have? What SBC board are you using? Please download the latest version of the source code, and try again.
*** Modtronix Engineering Support ***

jaa

  • Full Member
  • ***
  • Posts: 16
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #6 on: February 21, 2006, 04:48:21 AM »
Hi Admin,

I am using SBC68EC with rev 2.4. Why is latest rev. required?
Any way, when I try to build rev. 3.2 to update firmware of SCB68EC, there is a new error message:

Error - could not find file 'clib.lib'.
Errors    : 1


Br
Jaa

jaa

  • Full Member
  • ***
  • Posts: 16
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #7 on: February 22, 2006, 04:54:30 AM »
Hi Steve and Admin,

This is just to report that there was a very simple mistake from my side when I loaded your ior5etask.c in the source files ( bad refering file). Ones corrected, it is working OK and I am developing my applications using you very nice routines.
Thanks! :-)
Br
Jaa

steves

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #8 on: February 22, 2006, 05:06:19 AM »
Hi Jaa,

I'm very pleased to hear it's working for you. I have to say I was a little puzzled by the error message you got. Anyway, it gives me a buzz that someone finds my code useful.  8-)

Steve

Donatus

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #9 on: October 02, 2007, 07:02:49 PM »
Thanks for your code!   I tried it out and its working great!

This helped me also to understand how the IOR5E works too - I had become very confused because I'd expected that at least the power LED on the IOR5E would turn on at power-on so I thought my board might be broken or non-functioning.

I added your code and everything is now working great.  I've modified the webserver code so that it also turns on the power LED on the IO board at startup so it is a lot easier to see that the unit is turned on.

Cheers,

-D

javierdc

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: IOR5E relay and LED routines - code offered...
« Reply #10 on: February 06, 2008, 11:29:29 AM »
I added some sample code to control the relays and the leds via commands (HTTP): http://forum.modtronix.com/index.php?topic=258.0

The sample is based on the sample code from this post.

Javier

D.Drody

  • Full Member
  • ***
  • Posts: 10
  • [url=http://tierussianwoman.w-ru.com/]russian bikini bride[/url]
    • View Profile
    • russia marriage dating
IOR5E relay and LED routines code offered
« Reply #11 on: November 13, 2009, 08:02:20 AM »
will this also work for my 1999 600 f4? Im having the same dang issue