Support

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

Combination Circuits/Schematics

For general discussion related FlowStone

Re: Combination Circuits/Schematics

Postby tiffy » Mon Aug 07, 2017 3:23 pm

RUBY PROBLEMS ENCOUNTERED WITH PUTS, PRINT...sometimes it provides an output, sometimes the wrong output and sometimes nothing at all. Here I have compiled some examples to highlight the issues.

Even if I convert it to "output", I still encounter the same issues as mentioned above...and I don't see anything wrong with the Ruby Code ?
Attachments
Print - Output Problems with Ruby.fsm
(4.31 KiB) Downloaded 957 times
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Combination Circuits/Schematics

Postby tulamide » Mon Aug 07, 2017 7:28 pm

Those are console commands. You don't use a console for external communication, but Flowstone (thankfully!). So don't use them.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Combination Circuits/Schematics

Postby RJHollins » Mon Aug 07, 2017 11:22 pm

You guys are making me wonder .........

could we ever get FS to PRINT to a ............. printer ?
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: Combination Circuits/Schematics

Postby tiffy » Tue Aug 08, 2017 8:17 am

tulamide wrote:Those are console commands. You don't use a console for external communication, but Flowstone (thankfully!). So don't use them.


Hi tulamide, thanks for your reply.

Just to make sure I am tuned to the same frequency as you: When you refer to the "console commands" of Ruby irb, do you thereby mean the "print & puts" commands?

If so, I normally don't use the Ruby irb console commands i.e. "puts & print" but I rather use the Flowstone command i.e. "output 0, ..." - but as I stated previously:

"Even if I convert the Ruby irb Console Commands (i.e. print & puts) to the Flowstone command i.e. "output 0,...", I still encounter the same issues with that Ruby Code as mentioned... "

Unless there is something else I am overlooking in some of the Ruby Code in the previously attached schematics.

P.S. Regarding a previous post of mine on page 10, and I quote:

"tiffy wrote:Unfortunately, in DSP Ruby many things differ from plain Ruby irb console which have to be converted first for it to function in DSP Ruby and there is not much yet on the internet on DSP Ruby. It would be useful if Flowstone Admin could write a short course on DSP Ruby also covering the things I mentioned above and even sell it as a separate ebook...it don't necessarily have to cover every aspect of DSP Ruby, just the most used basics. Maybe, I should put this as a request in the "wishlist" ? "

As I said before, "print & puts" as well as "require" (which you also mentioned) is but some of the things that falls into the category which need to be clarified at least in the DSP Flowstone User Guide. (Unfortunately I can not recall all those things from the 'thumb'). For a Ruby noob like myself, those 'simple' things are not as obvious as it seems to the Ruby Guru's.

@RJHollins "You guys are making me wonder .........

could we ever get FS to PRINT to a ............. printer ?"

Good question, I never even tried to "print" to a printer using Flowstone. But if it can be done, it would be nice to be able to print out Flowstone schematics for example. Currently I am using a screen capture software to make pictures of my schematics which I then transfer into MS Word which can then be printed.
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Combination Circuits/Schematics

Postby tulamide » Tue Aug 08, 2017 10:43 am

Thanks, tiffy, I understand your concerns. Regarding ongoing issues after omitting these commands, I would assume that using them sets Ruby in an unpredictable state. The only way to reset Ruby is to exit and restart Flowstone. Try to make your changes until none of the commands exist anymore, save to a new schematic and restart Flowstone. If issues still exist, please upload that schematic.

Yes, there are simplified interface commands that have its roots in the unix/linux world. They refer to a so called standard input/output, which are defined globally as $stdin, $stdout and $stderr. They have no meaning while Ruby is embedded in Flowstone. For example, instead of $stdin all user input goes to Flowstone and Flowstone then hands over the input, that it wants Ruby to be aware of (like mouse clicks, but no direct key typing, for example)

Those commands belong to Ruby's kernel, which is another factor. Kernel commands can be quite powerful and therefore harm the interaction with Flowstone. Here's a list of standard input/output commands and methods that should be avoided:
Code: Select all
gets
p
print
printf
putc
puts
sprintf
warn


Additional kernel methods to be avoided:
Code: Select all
exit (i.e. Kernel::exit, Process::exit)
exit!
sleep
spawn
syscall
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Combination Circuits/Schematics

Postby tiffy » Fri Aug 11, 2017 11:09 pm

SELECTOR WITH OUTPUT: PROVIDING RUBY CODE TO MANIPULATE ELEMENTS IN ARRAYS:

Description how to use inside the Schematic.

P.S. I am working on a similar project for STRINGS as well, which when completed I will upload.
Attachments
RUBY CODE TO MANIPULATE ELEMENTS IN ARRAYS.fsm
(5.96 KiB) Downloaded 954 times
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Combination Circuits/Schematics

Postby tiffy » Sat Aug 12, 2017 12:10 pm

SELECTOR WITH OUTPUT:PROVIDING RUBY CODE TO MANIPULATE ELEMENTS IN STRINGS.

Pls note: I made the assumption that a sentence ends with one of the following characters: (. ? !)

I forgot to mention this on the description inside the schematic.

Description how to use inside schematic.
Attachments
RUBY CODE TO MANIPULATE ELEMENTS IN STRINGS.fsm
(6.69 KiB) Downloaded 960 times
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Combination Circuits/Schematics

Postby BobF » Sat Aug 12, 2017 5:32 pm

Hi Tiffy,

Nice stuff as always. I hope someday soon I can make some good use of them.
Keep them comming.

Take care, BobF.....
BobF
 
Posts: 598
Joined: Mon Apr 20, 2015 9:54 pm

Re: Combination Circuits/Schematics

Postby tiffy » Sun Aug 13, 2017 10:26 am

SIMPLE CALCULATOR (Picture Only):

I made this simple calculator which supports working with two decimal numbers but it can only do one calculation at a time. All the functions on the keyboard are functional...however, no fancy glitter like multiple stack or continuous memory etc.
Attachments
Simple Calculator.png
Simple Calculator.png (4.14 KiB) Viewed 26551 times
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Combination Circuits/Schematics

Postby tiffy » Mon Aug 14, 2017 10:00 am

Analog World Time Clock (Picture only):

The main clock dial keep track of S.A. time Johannesburg whilst the other four smaller clocks are synchronized with it keeping time of the following: New York USA, London UK, Sydney Australia, Paris in France.

The clock has a hidden switch from where one can select 20 different shells as well as another hidden switch from where a digital clock with time, day of week, date, month, year and a snooze alarm can be selected and set.

I saw the physical clock hanging on the wall of my accountant and it was out of order long time ago. So I had a good look at it and when I got home I decided to give that old clock life again in the software world. I also gave my accountant a working copy on CD.
Attachments
Analog World Time Clock1.png
Analog World Time Clock1.png (234.72 KiB) Viewed 26526 times
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 43 guests