Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

SDM-IO 16 - How to measure reed contacts


Phil_AT Jul 21, 2017 03:15 PM

Hi guys,

I am trying to connect a reed contact to a SDM-IO 16 for checking if a window is closed or not.

This is the code I am using to test the reed contact. A slightly changed version of the example in the SDM-IO 16 manual.

'CR6 Series Datalogger
'To create a different opening program template, type in new
'instructions and select Template | Save as Default Template
'date:
'program author:
Public Version(4) Public ComsStat(3) Public flag(16) Public Setup(1) Alias version(1)=OS_Ver Alias version(2)=OS_Sig Alias Version(3)=WatchDog Alias Version(4)=ComErr Public window_open As Boolean BeginProg window_open = FALSE
'Set up the SDM-IO16. Scan(1,sec,0,2) 'Set IO ports 1-16 to input switch closure. SDMIO16(Setup,ComsStat(1),0,90,2222,3333,0000,0001,1,0) NextScan
'Measure. Scan(1,sec,0,0) ''WINDOW OPEN COMMAND If window_open = TRUE Then SDMIO16(Version,ComsStat(2),0,90,9999,9999,9999,9919,1,0) Else SDMIO16(Version,ComsStat(2),0,90,9999,9999,9999,9909,1,0) EndIf
''CHECK PORTS SDMIO16(flag(),ComsStat(3),0,92,0,0,0,0,1,0) ' SDMIO16(flag(),ComsStat(3),0,14,0,0,0,0,1,0) NextScan EndProg

I can change the value of flag(2) if I set window_open to true (that’s what I need to access the relay which opens the window), but I am not able to connect this reed relay the right way and read the value I need for a logger controlled automatic mode.

What I tried is to connect the source wire to 5V and the normally open wire from the reed relay switch to one of the control ports of the SDM-IO 16. When I put a magnet near the relay it closed the switch, but I was not able to receive any signal.

I tried to set up several ports with modes from 2 to 5, no result.

All I get is 5V between every port which is not set to “Output logic low (0)” and ground.

Is it possible to drive a reed relay from one port (5v out/logic high) and measure the signal with another port (5v in/logic low) of the SDM-IO 16?

Thank you in advance,

Best regards


JDavis Jul 21, 2017 03:44 PM

The channels on the IO16 have 100kOhm internal pullup resistors.(channels default high) Use the channel and ground for the two leads to the switches. The channels will go low when the switch closes.


Phil_AT Aug 1, 2017 01:59 PM

Thank you very much. I overlooked this pullup resistor again and again.

Now it works perfectly.

Log in or register to post/reply in the forum.