Most awful hack job REDUX

Iggy, please cheer down. Controlling relays in the fashion you suggest is almost trivial to one skilled in the art, but you are asking for a very great leap, specifically from perl to RS-232. There are software drivers available to do this, and there are abundant websites with the circuitry that you'd need to implement it, and you could even probably find hardware drivers that perl could talk to, but there are intermediate steps. For example, perl can open a socket just like it can open a file. And, since I haven't heard otherwise, I'm guessing she can open a port, just like C can. But somebody would have had to have written the driver.

In assembly language, you can output a byte to a port. You can even do that in some C implementations. But to write directly to ports with modern operating systems, you have to have a driver that can get permission from the operating system to own that resource. And you have to get permission from the operating system to let your resourse preemptively issue system-level interrupts.

I guess you could boot in single-user mode, albeit it'd cut off your internet access... ( ;-p )

Good Luck! Rich

Reply to
Rich Grise
Loading thread data ...

Just to offer a mellowing of my tirade in my other response here:

The point is, not to quit trying stuff, and exploring, and doing new stuff - - But why do the same damn stuff that's been done thousands of times over before? That's what books and stuff are for

You don't have to discover everything about reality anew - you _can_ use other pepooles' reports of their experiences for references. Good Lcuck! Riuch

Reply to
Rich, Under the Affluence

I will talk about linux since I have no interest in microsoft windows.

There are probably drivers in the linux OS that treat RS-232 as a file descriptor. That is, high level applications could open /dev/serial or some such (my vague recollections) and then use system calls like read, write and fcntl to drive the serial port.

So, if I can get some circuit that could talk to RS-232 in its native form, then writing a linux app that would talk to RS-232, is just an exercise in programming.

I am not into low level programming and such, however I could do it.

chgrp lusers /dev/serial chmod 660 /dev/serial

The OS would translate system calls on /dev/serial into byte outputs.

Sorry, I cannot do without internet access.

Reply to
Ignoramus14135

Perhaps you misunderstand what I want.

I am not really looking for doing months of labor just for the sake of doing cute stuff.

The TIG inverter project, for example, is done so that I can weld aluminum. (even though, at this point, I realize that I already spent an ungodly amount of time and will rarely, if ever, need to weld aluminum). But at least there was some external justification, I thought, how about making a $7,000 AC welder for the price of $9.99 for the DC welder and some power electronics to convert it to AC.

Same is with these relays. If I can find a manufactured solution that can let me control relays via RS-232 or some such, I would gladly pay, say, $50 for it. $100 if it also provides digitized feedback.

Then I would use it to make toys and perhaps home automation or welding automation, etc.

i
Reply to
Ignoramus14135

According to Rich Grise :

Your program only controls the output signals from the controller which are fed to the relays controlling the lamps. It is still possible for a solid-state relay to short, or a relay contact to weld, so there is a benefit to be had from extra hardware to monitor the actual power to the lamps, and to switch onto blinking red mode if such a condition occurs.

Probably an interesting thing to watch -- but then there is the time lost testifying to the police and later the court case (if any).

Enjoy, DoN.

--
 Email:      | Voice (all times): (703) 938-4564
	(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
           --- Black Holes are where God is dividing by zero ---
Reply to
DoN. Nichols

You may wish to bookmark this link....

formatting link

Gunner

"The importance of morality is that people behave themselves even if nobody's watching. There are not enough cops and laws to replace personal morality as a means to produce a civilized society. Indeed, the police and criminal justice system are the last desperate line of defense for a civilized society. Unfortunately, too many of us see police, laws and the criminal justice system as society's first line of defense." --Walter Williams

Reply to
Gunner

Thanks Gunner. I browsd the site a little bit and did not find the application that I was looking for, but I will look some more.

i
Reply to
Ignoramus1487

you can also do ioctl() calls on the opened serial port to access the port pins directly, and I think it's possiblle to set it up so you can use use select() to wait for a status change, (if you just want to use it general purpose I/O instead of as async serial)

--

Bye.
   Jasen
Reply to
Jasen Betts

The funnest part was looking at the other driver in the eye, and deciding to get the f*ck out of the way.

What it was was, I was sitting at the stoplight, in the right-hand lane, waiting for the light to change. There was a car right next to me, in the left lane. It had just started raining, so the streets were slicker than snake snot. There was an armored truck approaching from the left on the cross-street, who had a green light. Apparently he was going a little bit fast for conditions, because he (the armored truck) started fishtailing. His fishtailing got worse, but he was on a new trajectory. His destination was right exactly in the spot where the car to my left was sitting, waiting for the light. He looked at me, with a sort of panic-stricken look in his eye, like, "My god! He's coming right at me!", so I just hit the gas, blew the light, got out of the guy's way, he did likewise, the armored truck hit the stoplight pole sideways, and came to rest right where the guy to my left had been sitting. (we were well out of the way by that time). The pole went down, of course, and the rest of the lights switched. I did give a report to the cops, but it seemed pretty open-and-shut - the guy lost control, took out the light pole, and came to a stop. There were no injuries, and the only damage was to the armored truck and the light pole, so I guess they dealt with it. All the cops needed from me was to tell them what I'd seen.

But it is kinda fun retelling the story. :-)

Cheers! Rich

Reply to
Rich Grise

Yep, just like I said. select and async I/O is a must if we want to incorporate fault tolerate and timers, and especially sockets./

i
Reply to
Ignoramus22022

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.