Any PID + TPO users out there?

Philip,

I am always timid in sharing this idea, but in your case, it might make the difference…
Check out event reactions on the brain.
You can do the ‘logic’ you need on the brain using them. This way, as you right say, when the network goes down, as long as there is power, the valve will be still controlling.

The Pac Managers Users guide - Doc 1704 - Chapter 4. Guide you it will.
(This rabbit hole is deep and dark, so take your light sabre and may the Opto be with you).

FYI - I recently re-rallied to try to get that TPO/PID fix/enhancement into the latest PAC Control (thinking it was just a little thing). Alas, it was more complicated than I’d hope so didn’t make 9.4. It’s still on the list, however. I will add your comments here into the ticket (for reference, it’s ticket #81017).

For anyone else that may be trying to setup PIDs to use TPO using the memory map, you need to call SetTPOPercent in the strategy or the TPO will not be enabled, even though the TPO Percent is being set from the PID.

I call both SetTPOPercent and SetTPOPeriod whenever communication is restored to the brain. It is okay to set the TPO Percent to 0 and that is enough to “enable” the TPO. There must be some place in the memory map that turn these things on that the SetTPOPercent writes to.

We enable the TPO function by writing a point mask to the memory map using this formula for the address:

PointStateMaskAddress = (modulenum * 0x4) + 0xF08C0040

The value you write to the address determines which points on the module are reset. So we write a 7 if we want TPO function enabled on points 0-2.

Thank you, I’ll add that to my notes here.

Hi Guys,

Since we’re getting into advanced TPO stuff here (thanks, SeanT!), a few more details/options/addresses that might be helpful to for you…[INDENT]
[/INDENT]

[TABLE=“class: wiki”]
[TR]
[TD][B]Memory Map Address[/B][/TD]
[TD][B]Length (Bytes)[/B][/TD]
[TD][B]Type[/B][/TD]
[TD][B]Name[/B][/TD]
[TD][B]Description[/B][/TD]
[/TR]
[TR]
[TD]0xF08C0000[/TD]
[TD]64[/TD]
[TD]bitmask[/TD]
[TD]Start Mask[/TD]
[TD=“align: left”]The associated pulsed output is started when a bit in this mask is set and stopped when a bit in this mask is cleared. To start pulsing at power-up, set bits in this mask and perform a [I]Store configuration to flash[/I] operation.[/TD]
[/TR]
[TR]
[TD]0xF08C0040[/TD]
[TD]64[/TD]
[TD]bitmask[/TD]
[TD]Start Must On[/TD]
[TD]A set bit in this mask sets the corresponding bit in the [I]Start Mask[/I] field. A clear bit in this field is unchanged in the [I]Start Mask[/I] field.[/TD]
[/TR]
[TR]
[TD]0xF08C0080[/TD]
[TD]64[/TD]
[TD]bitmask[/TD]
[TD]Start Must Off[/TD]
[TD]A set bit in this mask clears the corresponding bit in the [I]Start Mask[/I] field. A clear bit in this field is unchanged in the [I]Start Mask[/I] field.[/TD]
[/TR]
[TR]
[TD]0xF08C00C0[/TD]
[TD]64[/TD]
[TD]bitmask[/TD]
[TD]Pulsing[/TD]
[TD]A set bit in this mask indicates the associated pulsed output is active.[/TD]
[/TR]
[/TABLE]

-OptoMary

Cool, thanks for the tip! That helps me solve an issue I was having - after writing my default image to a brain, the TPO function was not enabled for any points until a power reset. I think it was working fine from just the config file, but the image was when it had trouble. I just had to add mem-map values to my config files for the necessary addresses and redo my images and the TPO function seems to work for all points on the first attempt.

Sean

I ran into a TPO issue today: If you disable a TPO controlled digital output with an event reaction, it turns off the TPO feature for that point. So when the event is reset, the TPO has to be enabled again by writing to the bit mask above or calling SetTPOPercent. I don’t know of a way to enable it again from the IO Unit itself, so have to do it from the strategy, which isn’t a big deal for me.

Hi Philip!

Wow, TPO AND event reaction on the same point, huh? That’s pretty fancy. You might be the only person on the planet who’s attempted that – patting head and rubbing tummy is what’ I’m picturing.

Anyway, I bet there’s a way in the brain (using Event Messages and a MemMap copy) to do such a re-enable; but if you can do it in your strategy, that’s probably less confusing and easier for your future self to troubleshoot, so I’d stick with that if you can.

Cheers,
Mary

Yeah, I look for trouble :wink: Anyways, in my application the TPOs are for fan coil control valves and the event reaction is for a fire alarm input, so I don’t really need to turn them off, only need to shutdown the fans. So I removed the control valve outputs from the reaction mask, problem solved, life simplified.

We ran into the same issue - but it is possible to reset TPO function by using an event message to write the correct value to the mem-map locations Mary posted.

Sean

Argh, just ran into this for the first time, was intending to have the output of my PID be a TPO. @mstjohn is this still an open issue? Reviewing the work-arounds, it doesn’t look that bad, but I’d like to triple-check with you all before I go implementing it

Mary isn’t at Opto anymore :frowning:

As far as I know, you still need to do the work around.

Thanks Philip, will do. Sad to hear that Mary’s gone, but thank you for the notice, explains a few unanswered queries in the recent past :\