I’m a newbee at this so what I am describing may not be the easiest way to accomplish my goal. I want to make an equipment status display with colored led’s (gif) that change when the register value changes 0 to 1 for example. My thoughts are I could display a default gif that will display all the time and if the register value changes to a true state another gif would move forward. Some type of If Then Else logic or if true then hidden. I’m hoping this can be done without taking a college course in Java Script. Another way I would like to use this technique is for Motor Status On or Off.
An if-else statement should accomplish what you want to do. Typically, you would have two images on the pages, say a red and green led image and they would overlay each other. When the page initially sets itself up, both images would be have their display attribute set to "none" or their visibility set to "hidden". Then when the page loads, a function containing your if-else statement would evaluate your test variable condition (on/off, 0/1, true/false) and then set the appropriate led display or visibility attribute to its "on" state to show the correct image.
You could simplify this a little -- more like your original idea.
You still need two images but the default always remains on your page, untouched by code. The active image lies over the default, and is normally invisible so allowing the default to show through. When the code makes the active image visible, that automatically covers the default. So the only thing the code needs to do is hide or show the active image.
This is getting much closer to the effect I want. Now to change from the mouse over to look at the 1 or 0 data point register on the embeded web server. Did you have some other examples. Thank you,
The slideshow code that I was thinking of is here. In particular watch out for the link code "SlideshowName.show(ObjectNumber)" as that is the code you would put in your "if" statement, something like this:
if (some condition){ //a boolean true/false or 0/1 state
SlideshowName.show(ObjectNumber);
}
"some condition" would contain the "look at the 1 or 0 data point register on the embeded web server". I hope you know how to do that because I don't
Posts: 9269 | Location: Wellington, New Zealand | Registered: December 11, 2003
Since the data you are interested in resides on the server, you would be better off using the server to tell the browser what to show. This can be done in several ways. The most common is via a PHP script; is this available on the server?
If not, how do you get the state of the data point? You need to get this value and pass it to your web pages somehow.
I think I can help. My e-mail address is in my public profile. If you can supply some details on the data point and how it is read, we should be able to get a script working for you.