How to tell via API if DutyCycle is supported?

Comments & issues
Post Reply
derammo
Fresh meat
Posts: 4
Joined: Thu May 14, 2020 6:46 pm
Contact:

How to tell via API if DutyCycle is supported?

Post by derammo »

I am writing a general interface for Phidgets22 to Helios 1.6 (virtual cockpit software.) So I am trying to support device classes in general without knowing ahead of time what devices the user may have.

Things are going well, but I ran into a problem: An InterfaceKit 8/8/8 reports that it has DigitalOutput. It also return MinDutyCycle = 0 and MaxDutyCycle = 1. However, it doesn't actually support DutyCycle I think, as it throws an exception if I set it to 0.1.

How am I supposed to know from the API that this is not supported? Is it a bug that MaxDutyCycle is set to 1 for devices that actually should just use "State" instead? I realize it supports the values 0 and 1, but it doesn't support any value in between :)
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: How to tell via API if DutyCycle is supported?

Post by Patrick »

You can use the ChannelSubclass Property. This will be None for regular digital outputs, and DigitalOutputDutyCycle for outputs supporting Duty Cycle.

-Patrick
derammo
Fresh meat
Posts: 4
Joined: Thu May 14, 2020 6:46 pm
Contact:

Re: How to tell via API if DutyCycle is supported?

Post by derammo »

Thanks so much. I had actually structured my code to do something like that because your API is always logical. But then I screwed up my test case and thought it was always "None."

Thanks!
ROP
Fresh meat
Posts: 2
Joined: Tue Jun 07, 2022 6:18 am
Contact:

Re: How to tell via API if DutyCycle is supported?

Post by ROP »

Can someone help me? I have a physical Cockpit with 5 Phidget card, I really want my 6 phidget card to talk to the SW Helios 1.6Virtual Cockpit. For the moment my Helios 1.6 (Nor 1.4) can`t add my Phidget as Interface: I think this was one of "derammo" initial problem as well. I Hope you have solved this ?
derammo
Fresh meat
Posts: 4
Joined: Thu May 14, 2020 6:46 pm
Contact:

Re: How to tell via API if DutyCycle is supported?

Post by derammo »

I have stopped development on the Phidget support for 1.6 due to me exiting the project.

I already replied to you on github, so I won't duplicate information here.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest