Study of the BlackBox Component Builder

Usage of the framework, compiler and tools
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Study of the BlackBox Component Builder

Post by Ivan Denisov »

Marcel Kollenaar wrote:Now I'm extending my code with this Services.DoLater concept to understand it.
BlackBox runtime providing cooperative multitask balancer in one thread.
You can add tasks with Services.DoLater
There are three options for the second argument:
- Services.immediately (doing task in execution flow of procedure)
- Services.now (doing task as soon as possible, then BlackBox free from over tasks)
- Services.Ticks() + timeMs (doing after some time)
User avatar
Marcel Kollenaar
Posts: 16
Joined: Mon Jul 26, 2021 1:33 pm
Location: Enschede, The Netherlands

Re: Study of the BlackBox Component Builder

Post by Marcel Kollenaar »

Thank you for the information.

V24
I tried to extend my code but in the end I had to use the same structure with a separate "PROCEDURE (a: Action) Do;" that runs the receiver code. I thought I could accomplish that within 1 procedure. So actually the code looks a lot at your code. The result is what I expected. It runs smooth and is rock-solid. I tested it in a long run and it kept receiving the bitstream. The only thing that happened is that my computer fell asleep and that produced an error Trap after I activated the system. So maybe that the power and sleep setting must be disabled or that it can check that the system signals a sleep cycle and stop the serial communication. When the system is asleep the Arduino keeps sending and BBCP misses data. For me this is not a problem.

POINTER TO ABSTRACT RECORD
I looked at the code behind all this "POINTER TO ABSTRACT RECORD" and first I read the parts in the book of J. Stanley Warford, page 184. He's telling about using the factory technique. The problem is you're actually creating a class but BBCP doesn't call that a class, here "factory" is "directories" a confusing term for me. A directory for me is a folder (new name) on a harddrive. I have to practice with this concept. I know the concept of classes and creating objects in runtime but I have to get used to the BBCP terminology and the way it is written. It can do OOP but for a reason unknown the wordt "Class" is not embraced.
The ABSTRACT record attribute confuses me. The Language Report says "A record type marked as ABSTRACT cannot be instantiated. No variables or fields of such a type can ever exist. Abstract types are only used as base types for other record types (see below)." The 3th sentence I don't understand, why should you use ABSTRACT when you are not able to instantiate it. Actually you do but later in the code with NEW.
cfbsoftware
Posts: 55
Joined: Wed Sep 18, 2013 10:06 pm
Contact:

Re: Study of the BlackBox Component Builder

Post by cfbsoftware »

As well as Warford's book I recommend you read:

Object-Oriented Programming in Oberon-2
Hanspeter Mössenböck

https://ssw.jku.at/Research/Books/Oberon2.pdf

In this book, O-O terminology like Classes, Objects, Messages, Methods etc. are correlated with the conventional programming terms. The author notes:

" These terms were introduced in Smalltalk, one of the first objectoriented languages, and have gained widespread acceptance
despite the fact that (apart from subtle differences) conventional terminology would have sufficed."

The "What's New" document accessible from BlackBox Help > Contents > Component Pascal states "Except for some minor points, Component Pascal is a superset of Oberon-2." and provides a good overview of the new attributes ABSTRACT, LIMITED and EXTENSIBLE
User avatar
Marcel Kollenaar
Posts: 16
Joined: Mon Jul 26, 2021 1:33 pm
Location: Enschede, The Netherlands

Re: Study of the BlackBox Component Builder

Post by Marcel Kollenaar »

cfbsoftware wrote:As well as Warford's book I recommend you read:

Object-Oriented Programming in Oberon-2
Hanspeter Mössenböck
Thank you Chris.

PS. Read your article about Astrobe in the Elektor Embedded Guide of 2010.

[Edit: The book of Hanspeter Mössenböck is good!]
User avatar
Marcel Kollenaar
Posts: 16
Joined: Mon Jul 26, 2021 1:33 pm
Location: Enschede, The Netherlands

Re: Study of the BlackBox Component Builder

Post by Marcel Kollenaar »

You might think it is a little quiet around this post and you are right. At the moment by times I work on the Arduino part. There is not much progress because there is also work to do for a living.

It took a while to realize I was running into the wrong direction. I first tried to mimic the RS232 communication to the TFA device with no luck. Then I went to a somewhat surgical method. I disconnected the old RS232 hardware in the TFA device and created a direct access to the memory chip to the RJ connector. Then I had to create a 5 V to 3.3 V level shifter with a BS108 mosfet. With a very noisy and disturbed signal I could read the data from the chip. The cable is about 1.2 m and have create a shorter one to decrease capacity of the cable to enhance the signal. They are all open collector so the positive going edge is terrible and the negative edge is sharp. The next part will be that a BBCP program will communicate with the Arduino and download the data. Some pictures to clarify it.
Attachments
SDA and SCL signals
SDA and SCL signals
Memory chip with SCL SDA and 3.3v
Memory chip with SCL SDA and 3.3v
Post Reply