Bliss
Eurobricks Citizen-
Posts
166 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Everything posted by Bliss
-
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
I uploaded again with some colors (Inputs) and some delimiting lines for clarity and also added A,B,C...H in the label for the outputs... Lego Demo Form in dot NET 8 -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Thank you for you feedback! As for the cw/ccw box, I think you confused with the Speed box. (I call this the speed but this is the amount used to increment the counter) cw/ccw is an indicator that shows the last direction of the rotation sensor. it is not the description of the followind box which is the speed. As for the Look, this is only a form to test the box, I did not want to put too much of effort to make it look like the real box. At least not for now. -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Thank you! Updated LegoDemo Program version Dot NET 8 This one should solve hopefully the First Attempt Connection fail and also the change of Com Port in the combobox while the Lego Box already running... Bliss -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Thank you for all your comments, recommandations and observations. I did not even notice we could run multiple instances of my Lego Demo Program :-) But actually, my ultimate goal, is to integrate some kind of basic language to allow the user to program logic interacting between inputs and outputs of more than one Lego Box. I will post a very preliminary version of this program that i'm working in parallel. It uses the same lego class engine but I removed all the buttons for now and provide just a textbox to enter a script and an output textbox to display results when applicable. This program will be a standalone exe. I was also thinking about making another program to control the Lego InterfaceB that would integrate an MQTT Client, i.e. some kind of Lego Gateway, so users could use Home Assistant and/or Node-Red (Home Automation) to program logics to interact between lego boxes on same PC (Program would allow 2-3 Legoboxes to run) and even between PCs with 2-3 lego boxes on each PC... About the Lego Demo progr., you said: Was there any error message in the textbox of the one that gets disconnected? Thank you again for your precious help. -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Thank you @Gunners TekZone for reporting the bugs. Indeed I did not test the opening of the second port while the first one was connected. (Even if I do not have a 2nd lego interface B, I have other com ports and just selecting one of them while one port was already in use, did give the same error.) So I think I found why and made the corrections. I updated the Projects: Updated Lego Demo Project in .Net Framework version. Updated Lego Demo Project in .Net *.0 version Bliss -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
I uploaded a new version of my Lego Demo windows app compiled with .net 8.0. Before it was .Net Framework 4.8... Here is the link for the whole souce and bin files... I tried to compile a standalone exe but not sure yet if really did... You should look at the exe in: folder LegoDemoB\bin\Release\net8.0-windows\publish\win-x86. Bliss -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hello @Gunners TekZone, Thank you for your feedback. Congrats fixing your faulty Interface B!!! Hats off! When you say you rebooted, you rebooted you PC or the application only? At the top of my program windows form, you select the COM port and click on Start Lego. Under the Start/Stop Button there is a textbox that shows the status of the connection and initialization... Do you get any statut message in this little texbox after you click the Start Lego Button? Did you try the EXE file in the BIN folder directly or used the setup in the publish folder? I noticed that if I select the wrong COM port and click start lego it may hang eventually and the only way to get back to normal is to remove the USB RS232 adapter and reconnect it... I updated the link with an improved version (I think). I also used costura.fody to build a standalone exe that has supposedly all dependant libraries DLL etc. Use the EXE file in the ...LLEGOInterfaceB\LegoProject\bin\Debug\app.publish . UPDATED Lego Interface B Test Program Thank you again. Bliss -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hello, I'd like to share with you a Visual Studio 2022 project I'm working on for the Lego Interface B. (I'm no professional programmer. Just doing this for fun) I have some ongoing projects for this great lego box but this one is an Upgrade (Including Performance Improvements) and merge of existing projects I did in the past for the Lego Interface B. (Originally, I did with VB.Net, now it is C# .net) I just saw my Lego Interface B few months ago getting dirt on a shelf and decided to get back to it :-) Here is the link to download this project: Lego Interface B Windows Test Form I already compiled it and you can find the .exe file in the Lego70909\LEGOInterfaceB\LegoProject\bin\Release folder. It should work directly if you have .Net Framework already installed. There is also a Publish folder with an installer that I did not tried. It is working on my home Computer (Windows 10) and I tested it on my job laptop which is Win 11. I had to resize the form though on the Win11 to see the Data Log textbox. The software is a form that shows Lego Intrerface B Inputs Status and have buttons to allow to control Outputs. There is no way yet to make some programming like activate a motor when a touch switch is ON etc... (this is on my to do list) Note that for the Outputs, there are a OFF and FREE buttons. OFF actually Stops and "BRAKEs" the motor, FREE will "Coast to Stop" the motor (FreeWheel). The form has a log window but it is not perfect as it might hang when there is to much lines in the text box... Also, The data is in Hexadecimal and sometime, would be better to Binary... Improvement on this maybe in next versions or I might get rid of this. One of the feature of this project is the use of multithreading and a Lego Class (Methods and Properties) that alows to create many instances of the Lego Box. This Test project has 2 tabs on the top named Lego1 and Lego2. So in theory, you can connect and run 2 Lego Interface B at the same time. I do not have 2 Lego Interfaces B to test this feature unfortunately. So I would appreciate if someone with 2 Lego Box could try this out and let me know how it goes. Thank you and Happy Holiday! -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hello @Toastie, For Light Sensor, leftmost 10 bit are definitely the analog value, not the 12 rightmost bits... I noticed that bit 4.3, for light sensor, will go "1" when light is blocked (or not enough light) and go to "0" when light source not blocked. It looks like the interface use this bit to turn ON/OFF the input led. But it's more tricky than just blocking the light, if you block the light source slowly, this bit wont change. (or if you unblock slowly as well). Also, Bit 4.4 goes 1 for one scan after 4.3 changes from 0 to 1 or from 1 to 0. In short, if you have a part that moves slowly in front of the light source, bits 4.3 will stay 0. It might stay 1 if you moved fast enough to block the light (goes to 1) then move slowly out of the light source. If a long part goes fast, bit 4.3 will go to 1 and when the long part unblock the light, this bit will go to 0. 4.0 & 4.1 seems to go to 1 at the same time for one scan when something block, unblock the sensor (Must not be too far away). Original instruction says Light Sensor can be used to: - Count using a pulley wheel (Could be the use for the 4.0, 4.1 bits?), - Work as an electric eye. - Sort color (grey scale) Bit 4.2 of light sensor, for me, remains zero at the beginning and then after having a very bright light like a bright flashlight near the sensor and removing this bright light from the sensor, this bit will go to ONE. After that, it will reset to zero if I bring back the bright light near the sensor. Bit 4.0 goes to ONE for one scan at every change of state (0->1 or 1->0) of the bit 4.2. I'm not sure there is any use for this bit 4.2 really... Bits 4.5, I do not know yet if it is of some use. I'm still testing... About the 4.3 bit, It appears that this bit for the rotation sensor is also used the same way as for the light sensor. It toggles the interface input led (1=Led off, 0= led on). This bit changes every 1/8 turn. For the Rotation Sensor, the bit 4.4 goes 1 for one scan after 4.3 changes from 0 to 1 and from 1 to 0. -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hello @AJB2K3, I do have a Lego interface B that I try sometimes to "interface" with it using modern technology :-) I did some VB Net, C# try out in the past. But if you want to do Control Logics that have outputs and inputs interacting together, it is not that simple. Blocky based programming may be more appropiate though... I was planning to try interfacing the Lego Interface B with an ESP 8266 or better, ESP32. ESP32 is cheap and has WIFI, Bluetooth, UART (Serial) etc... So I decided to go ahead after your posts :-) I have a M5Stack Core2 (ESP32 and M5Stack have UIFlow programming IDE that uses blocky) and I have many ESP32 Dev Board as well. So I started with an ESP32 Dev Board and flashed it with the latest MicroPython Binary. I'm using Thonny as an IDE but I guess there are many others good IDE. Since ESP32 UART is TTL and Lego Interface B is RS232, you need to get a RS232 to TTL converter module (MAX3232): Like this ONE. The cable I use is a straight DB9 to DB9, not nul modem in this case. Between a PC and the Lego Interface, I needed a null modem cable... About your code and my experience with the Serial Protocol of the Interface B: - Before writing the lego start string to the serial port, I empty the read buffer. - after sending the lego start string I check the read buffer until there are at least 31 bytes available because the successful started string reply has 31 characters long. You may implement a timeout to make things better. - After Lego has sent the "###Just a bit off the block!$$$" started string, it will start to fill the RS232 read buffer with 19bytes long block of data. (You should not "Flush" the read (or write) buffer.at this point..) # MicroPython code for ESP32 import machine from machine import UART uart = UART(1, baudrate=9600, tx=17, rx=16) uart.init(9600, bits=8, parity=None, stop=1, txbuf=256, rxbuf=1000) uart.read() uart.write(b'p\0###Do you byte, when I knock?$$$') while uart.any()<31: pass LegoReply=uart.read(31) if LegoReply==b'###Just a bit off the block!$$$': print('Lego STARTED') - If there are no glitches on your serial link, your code could just wait until Read buffer has at least 19 bytes than you read the 19 bytes, treat them and loop... while True: if uart.any()>=19: LegoReply=uart.read(19) print(LegoReply) - To be full proof, It would be better to program some validation, like the checksum of the 19 bytes that should be "FF" hex (0xFF or \xFF) If checksum not good, then discard first byte and read another one to make it 19 byte again and recheck the checksum. Loop if necessary. To check the sum: IF (sum(LegoReply) & 0xFF == 255). (& 0xFF: Sum will be 2 bytes long but only first byte is needed to be check against 255 (FF hex)) - Some lego lab docs says the block of 19 bytes always starts with "\x00\x00" so you could also seach the block of 19 bytes for ""\x00\x00"", if not at position 0, then, read the missing number of bytes out of the serial. For example, if you read 19 bytes, but "\x00\x00" is at position 3, discard the first 3 bytes and read 3 more bytes. - Unfortunately, lego lab docs do not always mention it clearly but the 19 bytes block does not always start with "\x00\x00". It can start with "\x10\x00" if the big red stop button is pushed on the interface while communicating. (Red led above the red button blinking fast). - Also, the second byte is not always \x00. In fact, every bit of this byte represent the status of output ports command. For ex.:, Sending command to activate Output A and C, the second read byte should be \x05 (00000101). So you will need more validation code here but this would make the process stronger. Hope this might help some... -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
@AJB2K3 Did you configure you serial communication correctly? I read somewhere: 9600 baudno flow controlno parityno modem control linesone stop bit8 bit data Yves -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
You may find some information on the net about alternative to the original software. For exemple: https://www.shamlian.net/projects/dacta/ (Provides Links and what seems to be a Dacta.zip that contains what seems to be some Python language stuff) The later URL has some interesting links about the reverse engineering of this interface. One of the links is from Anders Isaksson who also offers a little windows executable to test you interface which I recall having used successfully in the past: http://www.blockcad.net/dacta/ Another cool software to test your Interface B: https://www.lgauge.com/technic/LEGOInterfaceB/9751.htm I do have the RoboLab software that works on Windows 95 (And MAC) but it seems to be in french only. Other links of interest: https://www.dajlab.org/jcontrollab.html I also did play around on my own years ago with this interface and used the information provided by others to program some VB.Net stuff that you can still find here: https://app.box.com/shared/xc44rksi2h Yves -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Monivae, This 9751 works with older 9V sensors and motors. It is still worth if you have also a bunch of these 9V sensors and motors and have also recuperated the 9V power supply to power the 9751 unit. It is worth because this unit has 8 inputs and 8 outputs which makes it interesting if you have fixed projects requiring lots of motors, lights, sensors. You can even plug many to your computer to multiply to number of Inputs and Outputs. This unit communicate with a computer using serial port RS-232. So you need to buy USB-to-RS232 Converter for each 9751 you want to connect to your computer. The quantity of unit you can connect at the same time depends really how many USB port you have available. (I assumed you have newer computer that have no RS232 built-in port anymore). You also need a serial cable that you might also have been able to recuperate from the original unit. If you don't have the original serial cable, probably a standard null modem cable will do the job (Male DB9 plug at one end, female at the other end. May need sex changer). Once you have a unit connected to your computer and powered on, then you can use software provided here (Bricklab.zip) to test the Inputs and Outputs. You can also use this other software to test a 9751 unit: http://www.lgauge.com/technic/LEGOInterfaceB/9751.htm Once you managed to get it to work with the test software, let us know here and we can discuss further how you can make your OWN program that controls the inputs and outputs the way you want to... -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
I uploaded a new version of the Lego IntefaceB Modbus IO Server Gateway. https://app.box.com/shared/xc44rksi2h This version (V2) supports the use of TWO (2) InterfaceB on the same Modbus Server. I have only one InterfaceB so I did not test with 2 but I tested lego1 et lego2 independantly. This means you can program a PLC Application with OpenPLC that uses 2 Lego InterfaceB, i.e. twice as much Inputs and Outputs... -
Dacta Control Lab Software
Bliss replied to Dazmundo's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
I played with VB.Net about 10 years ago to get connected to my Dacta 9751 InterfaceB... Was fun project... But still, the language is not a real "Automation Friendly" one like we have in industrial automation. I would have liked to be able to program this little baby using simple "Ladder" language. Then, while browsing the internet recently I found out the OpenPLC project and that gave me an Idea... The OpenPLC supports the 5 languages according to IEC 61311-3. - Ladder (the most popular I believe) - SFC (Sequential Function Chart, or Grafcet, the best for sequential process) - FBD (Function Bloc Diagram. Has it's strenght... for me it's more for analog process and calculation) - ST (Structured Text, as in C) - IL (Instruction List... I don't use this one really) The OpenPLC supports the Modbus TCP protocol to communicate with I/O's. Since there are some Modbus Library code freely available, I had the idea to make a Modbus IO server with the Lego InterfaceB. I did not used my VB.Net but rather re-used the C# .Net code provided by: http://www.lgauge.com/technic/LEGOInterfaceB/9751.htm I modified it, improved the reading perfomance by using a continuous thread and stripped some code a bit, and I integretated the EasyModbusTCP Library and here we have a Modbus IO Server (Slave) using the Interface B. I then used some Modbus tool, like a Modbus Client simulator (Modbus Master) like the one provided by Radzio to test it. Then, I Installed the OpenPLC software as per their very clear instructions on their website and managed to build quickly a ladder program using Interface B I/O's... And it's very very performing. very fast response time. If anyone interested, here is my source code. (Exe is in the Bin\Release folder.). Please, read the Readme file. https://app.box.com/s/f1rpaucw84nd24md1neuuj8is4vuqmv2 In a near future, I would like to make it work with more than one InterfaceB... -
I'm Yves from Montreal city, Quebec province in Canada. While I don't consider myself a true AFOL as I don't build big mocs, I still love legos and I love to find out the unlimited creative talent of others. I'm not into castle, themes etc. I'm more into buildings, vehicles, technics (I have many technic sets... not the recent ones). I've been working in the industrial Automation fields (PLC = Programmable Logic Controller) for 30 years and I also own few mindstorms sets :) But I did not really "played" much with them yet. I've been off of the scene for about 10 years but recently, I stumbled on my old Lego Interface B (9751 - 70909) and had an Idea. 10 years ago or so, I did some VB.Net project to control this old baby. Was OK, certainly better than nothing but still lacking of some friendly programming language like we have in Automation. Then I had an idea to revive the Interface B. I'm going to share in the proper section if I can find it :) Here's my old brickshelf gallery: http://www.brickshelf.com/cgi-bin/gallery.cgi?m=YvesLev
- 2 replies
-
- technics
- mindstorms
-
(and 3 more)
Tagged with: