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-IO16 Programming


trashbk Jun 28, 2012 09:52 AM

Dear all,

I'm trying to program a SDM-IO16 for the first time. So far, I think I understood the concept of the SDMIO16 instruction.

What I do not fully understand is the modes for the ports.

The codes 0, 1, 6-9 are clear. But I do not understand to what codes I need to set the ports for the following applications because I do not understand what debounce filter means:

- reading a frequency of a CFV3 ventilation unit: is that Code 2, 3, 4 ?
- reading a frequency of an anemometer: Code 2, 3, 4?
- reading if a button on the enclosure is pressed (control if the maintenance staff was there), it is just a simple switch closure. Is that Code 3, 5?

Thanks in advance,
best regards


aps Jun 29, 2012 11:23 AM

The mode parameter configures the function of the I/O channel.

As you have seen in the manual they are:

Code Description
0 Output logic low
1 Output logic high
2 Input digital, no debounce filter
3 Input switch closure 3.17 msec debounce filter
4 Input digital interrupt enabled, no debounce filter
5 Input switch closure interrupt enabled 3.17 msec,
debounce filter

The first two are used to force a port to a given state as an output. Mode 2 is where the expected signal is a conditioned logic level signal, such as the output of the CFV3 or high frequency output anemometers that output voltage pulses. Mode 3 would be used with switches or reed relays where there is some risk of switch bounce (which could cause extra pulses for pulse count/frequency measurements). Options 4 and 5 are similar to 3 and 4 but related to a special, rarely used function, where the SDM-SIO16 can signal back to the logger that a port has changed state.

So for your applications:

CVF3 - use mode 2

Anemometer - this would be mode 2 for a pulse output anemometer or 3 if the anemometer has a reed switch internally. (Using 3 for a pulse output anemometer may appear to work initially but for many anemometers you will find the maximum windspeed they can measure will be artificially capped.)

For the switch use mode 3 - but to detect the button being pressed you will either need to poll the SDM-SIO16 fast to catch the change state of the channel whilst the button is being pressed or count the pulses on that channel.

* Last updated by: aps on 6/29/2012 @ 5:24 AM *


trashbk Jul 6, 2012 08:58 AM

Dear Andrew,

that means that for the use of the switch closure I have to count the pulses on that channel. Can I use the program code

SDMIO16 (PulseCount1,IO16Status,0,1,0,0,0,0,1.0,0)

for counting the pulses?

The switch closure is mounted between channel 1 of SDMIO16 and 5V of CR1000.

Thanks for your help.


aps Jul 6, 2012 01:49 PM

When I said you would need to pulse count the port for the switch I should perhaps explain that I did not mean you have to scan fast enough to hit the transition, but the you have to scan fast enough so you do not miss the button being pressed, i.e. if you tell the operator to press the button for at least one second and scan at 1 Hz you can just use the option to check the state of the input.

If on the other hand you do not want to scan at that rate or cannot trust the operators to press the button for long enough you can use the instruction you suggest, although previously in the program you would have needed to include another call to the instruction (perhaps only executed once before the scan starts) that configures that port for switch closure input.

As far as wiring goes you can connect the switch closure input between channel 1 or the SDM-IO16 and the adjacent ground terminal. The IO16 biases the input to 5V all the time, so when the switch closes it will pull the input low to ground.


trashbk Jul 6, 2012 02:24 PM

I just copy my program code now, because it is still not working well, although I really appreciate your help!

Just for being sure: C1-C3 of datalogger are connected to C1-C3 at the SDM-IO16, the C1-C3 ports of the datalogger should be configured as input (?) and the I/O port of SDM-IO16 (between GND and C1) is empty.

Button is connected between ground and channel 1 of SDM-IO16.


BeginProg
PortsConfig (&B00000111,&B00000000)
SDMIO16 (SDM_IO16_Dest,IO16Status(1),0,90,0,0,0,9993,1.0,0)

Scan (1,Sec,3,0)
SDMIO16 (IC_1,IO16Status,0,1,0,0,0,0,1.0,0)
NextScan
EndProg

Thanks for your help


aps Jul 6, 2012 03:12 PM

You do not need the Portsconfig instruction as the logger will work that out itself. 12V and G need to be connected between the two devices too, but I think that is obvious.

You should find that the variable IC_1 will increment at least once on each switch closure (it should be once but it depends on the switch). However, with your program it will be easy to miss the switch press as one second later it will be overwritten with a zero (the pulse count in the next second).

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