Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 4:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: February 21st, 2008, 7:46 pm 
Offline

Joined: August 31st, 2006, 3:21 pm
Posts: 10
Location: Bristol & London
Sandy…you’re a star!! :D

Seems to work fine

Just one thing, and I’m sure I’m being really think or I’m just really tired, how do i get that text data into a variable? :roll:

The boards can switch in 20 to 80 milliseconds depending on bus traffic

Thanks mate!

Phil


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2008, 8:08 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
it's already in a variable called MyData.



The pub was a very basic one to check to see if the file would drive your controller.


depending on how you name your LED's I would create a function which would do all the hard work, then in your main program, you just call the function. It depends how much work you want to put into the program.


If you named all your LEDs individually, you could create ON/OFF functions
and the script would be

LEDOn(55)
wait(1)
LEDOff(55)

which would switch LED 55 on for a second, then off---if you put it in a loop, it would flash

you could

create a counter (i)
then
LEDOn(i)
wait(0.5)
LedOff(i)

would sequentially light LEDs for .5S

Which control board do you use??

and what is the command/script you use to copy to the Com1 port??

---it would be very handy to know. I have a barcode scanner, which accepts serial inputs to set it up.


Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2008, 8:52 pm 
Offline

Joined: August 31st, 2006, 3:21 pm
Posts: 10
Location: Bristol & London
Hi

Just noticed a problem :(

If the code is 0 (I think it’s the ASCII NUL character) it doesn’t ‘print’ anything to the text file, just emptiness…..oh hmmmm

To send the txt file to a com port I use the action, file management / copy file
Put com1: in the ‘to location’ box
Note: it must be just com1: not com1:\ or it wont work (opus seems to keep putting a \ by default every time its edited)
Just set the baud rate etc for the device in windows settings

Cheers


Phil


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2008, 10:19 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
There's always a problem!! :-)

how often is the null used?? and in which bytes??

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2008, 10:54 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
There may be a way out.

You can't write a null to a file, but you can append a file which already contains a null, so going back to scripting, it may be possible to find a way round the problem. It depends on where the null may appear in the data block.

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2008, 11:04 pm 
Offline

Joined: August 31st, 2006, 3:21 pm
Posts: 10
Location: Bristol & London
ahhhhh... :?

the null can be any of the middle 4 bytes, never in the last (timer) or first (board no.) bytes.
It's basically the off or stay off command for each bank of the 4 channels of 8 lights, so a very often used command

Regards

Phil


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2008, 11:46 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
So each channel has only 8 LED's? Is it possible to 'cheat' just use 7 LED's per channel...so no LED at 00000001 or 10000000 and use that as the off?? or is it a bit more complicated?? or too late to do that??

It gets 'messy' but I think still possible to start with files with 1, 2, 3 or 4 nulls.
copy that to a new file, then insert the other codes ---like a shift register.


what happens if you use a unrecognised code?? perhaps it will treat it as a null???

what is the Control card???

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group