If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Streamboolout in Code component
5 posts
• Page 1 of 1
Streamboolout in Code component
Hi,
I have been using the code component to read the signal from a PWM module. The idea being to trigger every time the pulse from the PWM is high, and the frequency of the pulses varies (prototype for an engine dyno). I haven't been able to find a way to do this using the standard components.
I have the code component working and a scope shows the output to behave as expected. I am trying to use the 'streamboolout' function to output high every time a PWM high signal is detected so this can activate a counter.
I can't get the streamboolout to output any sort of signal, the bool output symbol on the right side of the code module us just grayed out, maybe I'm using the wrong syntax. I've tried:
streamboolout = 1;
streamboolout = 0;
streamboolout = high;
streamboolout = low; etc
How do I get the code component to output using streamboolout?
I have been using the code component to read the signal from a PWM module. The idea being to trigger every time the pulse from the PWM is high, and the frequency of the pulses varies (prototype for an engine dyno). I haven't been able to find a way to do this using the standard components.
I have the code component working and a scope shows the output to behave as expected. I am trying to use the 'streamboolout' function to output high every time a PWM high signal is detected so this can activate a counter.
I can't get the streamboolout to output any sort of signal, the bool output symbol on the right side of the code module us just grayed out, maybe I'm using the wrong syntax. I've tried:
streamboolout = 1;
streamboolout = 0;
streamboolout = high;
streamboolout = low; etc
How do I get the code component to output using streamboolout?
- nkiernan
- Posts: 7
- Joined: Tue Oct 05, 2010 3:11 pm
Re: Streamboolout in Code component
Hey nkiernan, Welcome to Flowstone
Something like that should work..... if your still having problems then post an .fsm file of what your trying to do and I'll see if I can see where you are going wrong.
Cheers
Exo
- Code: Select all
streamin pwm;
streamboolout high;
streamboolout low;
streamout countHigh;
float oldpwm;
high = (pwm>0) &(oldpwm<=0); //A streamboolout should be a comparison and not an actual variable.
countHigh = countHigh+(high&1);
oldpwm = pwm;
Something like that should work..... if your still having problems then post an .fsm file of what your trying to do and I'll see if I can see where you are going wrong.
Cheers
Exo
- Exo
- Posts: 426
- Joined: Wed Aug 04, 2010 8:58 pm
- Location: UK
Re: Streamboolout in Code component
Hey Exo, thank you for the welcome. I'm enjoying the experimentation with Flowstone, but coming from Pure Data there are certain objects missing that I'd be used to. Just getting my head around the work-arounds.
Thank you for the code advise also. I've attached the scaled down .fsm file I'm working on and have added the comments in the schematic to show where I'm having problems! I'm sure its something simple I'm missing. Sorry if I'm wasting your time on trivial inquiries.
Thank you for the code advise also. I've attached the scaled down .fsm file I'm working on and have added the comments in the schematic to show where I'm having problems! I'm sure its something simple I'm missing. Sorry if I'm wasting your time on trivial inquiries.
- Attachments
-
- Signal_Generator_001.fsm
- Test signal generator section of an engine dyno project
- (74.73 KiB) Downloaded 1611 times
- nkiernan
- Posts: 7
- Joined: Tue Oct 05, 2010 3:11 pm
Re: Streamboolout in Code component
Ah I see what you are doing now....
To get from stream to "green" you need the component "Mono to Float" with a "ticker 100" .
I would do the counting in code though, the code component is sample accurate where as sampling to the "green" data is limited to 100hz.
Exo
To get from stream to "green" you need the component "Mono to Float" with a "ticker 100" .
I would do the counting in code though, the code component is sample accurate where as sampling to the "green" data is limited to 100hz.
Exo
- Exo
- Posts: 426
- Joined: Wed Aug 04, 2010 8:58 pm
- Location: UK
Re: Streamboolout in Code component
Exo, thank you for your help. That makes good sense, I'll see how I get on with your suggestion. Thanks again.
- nkiernan
- Posts: 7
- Joined: Tue Oct 05, 2010 3:11 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: az-terisk and 28 guests