Visual Basic to BS2p-40
Jedwood
Posts: 2
I have built a firework launching system which is controlled by a BS2p-40.
I use a combination of 1-5 (Banks) and 11-20(Channels) in a matrix to control 60 individual relays to ignite the firework fuse. Currently the program runs through all 60 fireworks individually, by taking OP1 high and OP11 high, I can switch one relay, then OP1 high and OP11 high I can switch the next relay etc. This system is tried and tested and works perfectly, but takes the fun out of igniting fireworks. The next evolution in my head is to try to control this sequence individually at the click of a mouse, using VB and a serin command.
For instance, clicking on an icon in VB will send a serial code to the BS, and it will then follow this command with a certain combination of OP high commands. 60 VB buttons = 60 fireworks. I just need some help with the VB to serial output, and SERIN to outputs on the BS2.
Its as simple as:
In VB, Double click button 5, VB will output 00000101 (dec 5)
BS2 receives serial 00000101 and takes OP 1 and OP15 high, wait 2000, OP1 OP15 low.
In VB, Double click button 12, VB will output 00001100 (dec 12)
BS2 receives serial 00001100 and takes OP2 and OP 12 high, wait 2000, OP2 OP12 Low, etc....
I hope I have been able to explain this sufficiently. If anyone is interested I can post some photos and schematics of the system.
Great forum by the way!
Any help is appreciated.
John
I use a combination of 1-5 (Banks) and 11-20(Channels) in a matrix to control 60 individual relays to ignite the firework fuse. Currently the program runs through all 60 fireworks individually, by taking OP1 high and OP11 high, I can switch one relay, then OP1 high and OP11 high I can switch the next relay etc. This system is tried and tested and works perfectly, but takes the fun out of igniting fireworks. The next evolution in my head is to try to control this sequence individually at the click of a mouse, using VB and a serin command.
For instance, clicking on an icon in VB will send a serial code to the BS, and it will then follow this command with a certain combination of OP high commands. 60 VB buttons = 60 fireworks. I just need some help with the VB to serial output, and SERIN to outputs on the BS2.
Its as simple as:
In VB, Double click button 5, VB will output 00000101 (dec 5)
BS2 receives serial 00000101 and takes OP 1 and OP15 high, wait 2000, OP1 OP15 low.
In VB, Double click button 12, VB will output 00001100 (dec 12)
BS2 receives serial 00001100 and takes OP2 and OP 12 high, wait 2000, OP2 OP12 Low, etc....
I hope I have been able to explain this sufficiently. If anyone is interested I can post some photos and schematics of the system.
Great forum by the way!
Any help is appreciated.
John
Comments
http://forums.parallax.com/showthread.php?t=96973
Jeff T.
Jeff, thanks for the link. I havent been able to explore it fully, but what I have seen looks very interesting. Thanks very much.
John