Serial character event

Hi,
I want to ask a question that has been asked on this forum many times before, but there's no clear answer to it.
I am using serial port communication to talk with a microcontroller. As soon I open the serial port I want to enable the serial character event. The incoming data is indefinte in terms of when it will arrive and how long the data will be. Thus, this event should quitely be listening to the port all the times and read data whenever bytes at serial port are greater than 0. (Something very similar to On_Comm event in C#)
In parallel to listening the port, I want to be able to fire other events like button click which may result in sending data through serial port and updating messages on UI.
I went through the documentation and found detect break event example. I implemented something similar. I call this VI after I successfully connect to the micrcontroller through the serial port. But it locks my UI and all I am doing in the program is listening to the serial port.
Any suggestions?
Thanks.
Attachments:
Data Receive Event.vi ‏27 KB

You may want to rethink your architecture, provide some more details on what the main VI looks like.  Because of dataflow, the main program won't continue past the subVI until the sub VI provides its outputs.  There are ways around this using some VI server calls, but I can't help with this much because I am just beginning to figure those out myself.
But basically, if you have code that is dependent on the output of a subVI, it won't execute until the subVI is complete.  Code running in parallel loops that is not dependent on the subVI will still run.

Similar Messages

  • Too many Serial Port events...?

    I've written Java code to connect to a serial port and receive data, and it's all working fine. But why when I send a message such as "msg from nicks PC" do three events get fired instead of a single event? That means my application interprets it as three messages
    1 -> msg from
    2 -> nicks P
    3 -> C
    I've tried
    mySerialPort.enableReceiveTimeout(500);
    but it doesn't seem to change anything...
    Anything else I can try?
    Cheers
    Paul

    It would help to see some code and know what kind of events are getting fired.

  • Serial port events

    I have a serialport dataRecived event with 3 methods inside it. The LogFile is loging dana, drawSetpoint is drawing a graph on a chart based on the input form the user. DrawInput is drawing a second graph which come from my Arduino.
    public void serialPort1_DataRecived (object sender, SerialDataReceivedEventArgs e)
    DateTime time = DateTime.Now;
    string Rdata = serialPort1.ReadLine();
    textFile(Rdata, (int)numericSetpoint.Value);
    drawSetpoint(time,numericSetpoint.Value.ToString());
    drawInput(time, Rdata);
    Console.WriteLine(Rdata);
    The numericSetpoint keypress looks like this:
    public void numericSetpoint_KeyPress(object sender, KeyPressEventArgs e)
    if (e.KeyChar == 13)
    if (serialPort1.IsOpen)
    int setpoint = (int)numericSetpoint.Value;
    string stp = setpoint.ToString("D3");
    char[] set = stp.ToCharArray();
    char[] dataSend = new char [6];
    dataSend[0] = Convert.ToChar("<");
    dataSend[1] = Convert.ToChar("S");
    dataSend[2] = set[0];
    dataSend[3] = set[1];
    dataSend[4] = set[2];
    dataSend[5] = Convert.ToChar(">");
    serialPort1.Write(dataSend, 0, 6);
    PrintCharArray(dataSend);
    else
    MessageBox.Show("Port not open");
    As you can notice both LogFile and drawSetpoint take one argument from the numericSetpoint control (numericUpDown). The problem is drawSetpoint starts to draw immediately when i start typing, it doesn't wait until i press ENTER. So if i wanted to set 150
    it would draw 1,15 and then 150 on the chart (as I'm entering numbers on the keyboard). The same behaviour can be seen in the LogFile. Files are being saved in a text file which looks like: 00.00,00 and after entering it would look like
    0.00,7
    0.00,7
    0.00,70
    0.00,70
    Same problem, it logs while i'm typing. I would like for both function to take the argument after i press ENTER to avoid this. How should i proceed ?

    Why fixing it? It works correctly..
    btw, as it seems that your problem is more general WinForms related, start with a button which sets your data. Don't try to use the key press event of your text box.
    Wrong term, i meant how to change it. Adding a button doesn't help, datareceived event still fires when i try to enter something in my numericUpDown control.

  • Building a diagnostic tool to monitor serial port events

    Hi,
    I'm writing a diagnostic tool. I have two Windows machines communicating via serial ports. I need to treat the software on both machines as "black boxes." I would like to peek at both the sent and received data at one machine and save to a file without emptying the buffers.
    Does have LabVIEW have access to these data? Can we look at it without emptying buffers?
    Thanks,
    FgH...

    You can access to the data you like by wiring from the sent or
    received data
    bufferd line. But, cabablity of this way quite depends on the data
    sampling rate
    because the monitor is the most time consuming process on LV.
    As I've experienced, you can do it in less than 100Hz rate per one data.
    And saving to a file may be done after some interval repeatedly. The
    files are
    better smaller sized ones, so the data is to be storaged in a couple
    of data files.
    As for more practical method, i have to know your diagnostic tool in
    detail
    as far as possible. Tom
    haibach wrote:
    > Hi,
    >
    > I'm writing a diagnostic tool. I have two Windows machines
    > communicating via serial ports. I need to treat the software on both
    > machines as "bla
    ck boxes." I would like to peek at both the sent and
    > received data at one machine and save to a file without emptying the
    > buffers.
    >
    > Does have LabVIEW have access to these data? Can we look at it
    > without emptying buffers?
    >
    > Thanks,
    > FgH...

  • VISA Wait on Event User Event

    I have a Producer/Consumer program that uses an Event Structure to handle the UI button presses.  I want to be able to use the VISA wait on Event to read characters from the RS232 port.  So in my Event Structure I created a case for dynamic user events.
    I also create a while loop that has the VISA Enable Event and VISA Wait on Event in it. I enabled the "Serial Character" event only.  When I get this event I use the Create User Event.VI and Register for Events to get a Event Refnum
    How do I get the Event Refnum from this loop into my Producer loop?
    Solved!
    Go to Solution.

    Paul_Knight_Lockheed_Martin wrote:
    Here is the code
    No, that is not the code. That is one subVI and a picture. Where are you waiting for the VISA events? Where are you generating your user event? Based on the picture you are calling the Initialize_Controller_Communication and remaing in that code until the Stop buuton is pressed. You will not start your event structure in the producer loop until this VI completes. So, if you are not hitting the stop button to complete your initializtion it is no wonder you are never seeing your event structure run.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Migration from Serial polling to Serial queue with event handler

    Hi, I am trying to migrate from classical serial polling communications to serial queue with "event handler" for the buttons pressed by the user. I have placed four while loops, one for the event handler, a second one for serial reading, a third one for serial writing (depending on what button was pressed) and the last one for processing what was read from the serial reading while loop, via a queue.
    My attached device reads the signals from 8 sensor ( 4 temperature and another 4 temperature plus humidity in the same sensor ) and send them via serial to Lavbiew.
    First of all, only once just after running the LV program, I must turn on my attached device with an ON command plus a carriage return after that the device will respond with the number of sensors plugged to it, disabling the corresponding buttons in the front panel. Then labview must wait until I pressed Acquire Button (event handler) and send a CF command plus what sensors to acquire plus a carriage return, then the device will respond continuously to labview with the sensor readings until I press the stop button (event handler), there is also another button to exit the program, also with event handler.
    I am having problems using the event handler and the queues because I am new using these structures, I have looked at  the LV examples but there is nothing concrete on using serial with event handler and queue.
    Take a look at my VI and you will soon notice what kind of problems I am having, any suggestions will welcome.
    Thank's in advance.
    Regards.
    Attachments:
    serial queue.zip ‏76 KB

    Hi Luisete,
    Maybe the problem arise because you are En- and DeQueue in parallel. You do a lot of things in parallel, that is nice if you are sure that one loop doesn't have to wait for another loop. Make sure you don't dequeue before enqueue.
    Hope this helps
    I never knew that the standard error cluster output could be wired directly to the loop control of a while loop.
    First time I see this

  • Event structure freezing when short delay inserted

    Well, the simple stuff in LabVIEW I can do, but I'm still struggling to get my head around the concept of "Events" and how LabVIEW handles them. If I only have one type of event (i.e., pushing a button out of several on the UI, or reading a serial input and handling it programatically), I think I'm good. But my application requires me to be able to handle either of these at the front panel.
    Going through the LV Knowledgebase got me this link (it's a little old - LV8.6, but seemed to handle the basics), from which I downloaded "events.vi" (attached). My situation is a little different, so I modified it a bit to "EventExperiment.vi" (also attached) to have a bare-bones template I could use for my application. If I run it as shown, it seems to run fine (with a serial input, the "1" and "2" lights turn off, but the Bytes at Serial Input indicator always shows "0" and the "Serial Indicator" light never lights - I am assuming that these change and revert too quickly to see in the UI). My concerns with my VI are:
    If you add a short delay in the processing of the serial input event (say 1 second delay in that event case, or even a 1 second delay subVI after the serial flush connected through the error line), the VI accepts no further UI input after the first serial event.
    If you add an error wire through all the events subVIs (whether you merge this wire with the one going through the serial subVIs, the program just hangs up.
    And, one little bothering thing is that the original "events.vi" takes three presses on the "stop" button to close. I'm figuring here that it's because of those local variables being passed between loops, but it hasn't been enough of a bother to worry about.
    Your help is greatly appreciated,
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ
    Attachments:
    events.vi ‏24 KB
    EventExperiment.vi ‏25 KB

    Well, I thought I'd add a final post for some closure to this one.
    To summarize what I was trying to accomplish: I wanted to have some kind of an event structure where you could use both regular User Events (button pushes, numerical control changes, etc.) and an outside (non-keyboard/mouse/touchscreen) event, like a serial character coming into a COM port, to initiate an action. This was to eliminate a loop where the computer would be polling the COM port continually at a pretty fast rate. (I must have read a hundred times in the past month that you don't want to run a While loop for polling if you can help it.)
    It turns out (after a couple of confusing days, I talked with the NI service engineers) that you can't do this. In order to detect a character at a COM port, you have to be polling the port periodically with a Read and look for a change in the bytes available or another parameter. You can do this through a timed loop separate from your Event loop or through a Timeout event case inside the loop, like Don_Phillips suggested.
    However, I believe I'll go the separate loop route, since my head's actually more comfortable with it than the Timeout route.
    Thanks, folks, for your help,
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Funny/odd event handling

    Hi All,
          Ran into this really wierd bug - wasn't sure whether anyone might be interested.
    An event producer loop (LocalBytesAtPort value-change) is throwing it's event, even though the Error-case is executing.
    If the value-change-node is being called, the the bytes-at-port probe should show data, but it doesn't.  The error probe (from inside error case) is getting fresh values.  Yet event-loop is ticking over and handling value change at the same period as the value-change producer. 
    I know this is cryptic, but I hit Post too soon    and have to explain it in a short time!
    Cheers
    P.S. There's supposed to be a 16color bmp, (bmp is only option) but can't post it!
    Message Edited by Dynamik on 04-26-2006 11:57 PM
    Message Edited by Dynamik on 04-26-2006 11:58 PM
    When they give imbeciles handicap-parking, I won't have so far to walk!

    Hi tst,
    Re: bmp blocking - at 16colors it was only 330K!
    Anyway, I did look for other places the LocalBytesAtPort might be changed, but the FP indicator is only updated from one place - the producer loop via Value (signaling).  After messing with it, it started working - but what did I do?  I accidentally left a 11ms wait in the producer-loop!?
    Re posting as 7.1, Looked over th VI to assess the damage (from missing VIs) if only top-level was supplied - not too bad...
    To reiterate, [before 11ms timeout was added] the Error-case was executing every 1111ms, but Event handler was receiving a Value-change event for LocalBytesAtPort!
    Leading-up to the error condition [w/out 11ms TO], there are several thousand Serial-Character VISA Events in rapid succession.  I had a problem firing notifiers with for-loops without a wait, maybe this is related...
    Cheers!
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    Dvr.Sky.TXRDaemon.vi ‏227 KB

  • VISA wait on Event crashes RT target

    After adding code that included a VISA wait on event (serial character), my cFP-2220 with LVRT 2012SP1 stopped answering when LabVIEW tries to halt the running code to do a build or deploy...(The code works otherwise works fine).
    The code on the controller seems to stop (all activity can be seen halting), but the VISA-part seems to still be hanging, or have crashed the controller (web and ftp interface goes down as well).  If I just reduce the given timeout from 100 ms to 50 ms, the problem disappears. 
    My own interpretation of this is that the rules that is supposed to enable the host PC to halt code on the RT-target is simply not abided by the VISA wait function, and if that function happens to be waiting while the command is issued, and this wait does not happen to time out relatively shortly after the command has arrived, it will cause a crash.
    Is this a bug, is there a workaround other than not using events (I changed the code from polling to events to be able to detect 5/10 ms silence time on serial ports without using all processing time on it...), or is it expected and not considered an issue?
    MTO

    James-K wrote:
    Artst,
    Can you post a screenshot of your code to further clarify?  
    It sounds like you are trying to stop the VIs by clearing the reference while it is still in use which will lead to a crash.  There is not a way to "unblock" a VI once it is running.  Can you specify a timeout instead?
    Well, I think this is not giving enough credit to the actual problem. One common VISA programming paradigme in the standard C API is to actually let a VISA Read (and of course a VISA Wait on Event) to terminate with an error by issuing the viTerminate() function, which I believe should be possible to get optionally be called by VISA Close too. Unfortunately there is no direct access to any VISA Terminate function in the LabVIEW palettes, but I have in the past created a small VI which calls the underlaying VISA API directly to abort any stuck operations on a session. Possibly this VI could solve the problem, making the VISA Wait On Event return before the VISA Close pulls its session under its feet.
    PS: Why can't I upload the VI directly to the board? Is it because it is in LabVIEW 7.1 format??
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    VISA Close with Abort.zip ‏10 KB

  • How to Exchange Data and Events between LabVIEW Executable​s

    I am having some trouble determining how to design multiple programs that can exchange data or events between each other when compiled into separate executables. I will layout the design scenario:
    I have two VIs, one called Status and the other Graph.  The Status VI displays the serial number and status of each DUT being tested (>50 devices).  The Status VI has one timed loop along with a while loop that contains an event structure.  If the user clicks on the DUT Status Cluster the event structure needs to pass the serial number to the Graph VI.  The Graph VI when called fetches the records for the DUT based on the Serial Number and time frame.  This VI is a producer/consumer so the user can change the time frame of the records to display onto the front panel graph.
    I have a couple reasons the VIs need to be separated into independent applications. One being the underlying database fetches tends to slow the threads down between the two VIs; the other is that they may be distributed into separate systems (don't consider this in the design criteria).
    I have been researching the available methods to pass the serial number to the Graph VI.  My initial idea was to us a command line argument, but this does not allow the Status VI to pass another Serial Number to the Graph once it has started (I do not want to allow the user to execute multiple Graph applications because the database query can load down the server).
    Is there a program method that I can implement between the two VIs that will allow me to compile them as two executables, and allow the Status program the repeatedly send an updated serial number event to the Graphs program.
    I have reviewed many methods; Pipes (oglib_pipe), Action Engine, and Shared Variable.  I am not sure which method will give me the ability to use a Event driven structure to inform the Graphs program when to update the serial number.  Any suggestions and tutorials or examples would be greatly appreciated.

    I have used the Action Engine (aka: functional global) approach for many years and it works well. Something to think about is that if you make the event's datatype a variant the only code that will need to know the actual structure of the event will be the function that needs to respond to it. Hence, a single event can service multiple functions.
    Simply create a cluster containing an enum typedef that is a list of the functions that the event will service, and a variant that will be the function event data. From anywhere in the code you can fire the event (via the functional global) by selecting the function from the enum and converting function specific data to a variant. On the receiving end the event handler uses the enum to determine the function that is to get the data and sends the variant to it. The event handler doesn't know or care what the actual event data is so you could in theory add new functions without modifying the event handler.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • SAX parser splits up character data; I expected Ign. whitesp

    Im am working on a XML parser for loading data from some back
    end systems into an Oracle 8i database. I am using the SAX
    parser for this purpose. After doing some tests with larger
    amounts of XML data (> 1M), I found some unexpected behaviour.
    The parser sometimes splits up character data into two chunks of
    data. The XML looks as follows:
    <TAGNAME> this is the character data </TAGNAME>
    The parser raises the following events:
    1 startElement name = "TAGNAME"
    2 characters chbuf = " "
    3 characters chbuf = "this is the character data "
    4 endElement name = "TAGNAME"
    I expected an ignorableWhitespace event at step 2. The XML
    document contains repetitive tagnames. The strange thing about
    the parse process is that the parser splits up the character
    data only sometimes, and I can't determine any kind of logica
    for this behaviour. Most occurrences of exactly the same tagname
    and character data are parsed correctly (that is, as I
    expected).
    Am I dealing with correct behaviour here, or is it a bug??
    Rolf.
    null

    Oracle XML Team wrote:
    : Rolf van Deursen (guest) wrote:
    : : Im am working on a XML parser for loading data from some
    back
    : : end systems into an Oracle 8i database. I am using the SAX
    : : parser for this purpose. After doing some tests with larger
    : : amounts of XML data (> 1M), I found some unexpected
    behaviour.
    : : The parser sometimes splits up character data into two
    chunks
    : of
    : : data. The XML looks as follows:
    : : <TAGNAME> this is the character data </TAGNAME>
    : : The parser raises the following events:
    : : 1 startElement name = "TAGNAME"
    : : 2 characters chbuf = " "
    : : 3 characters chbuf = "this is the character data "
    : : 4 endElement name = "TAGNAME"
    : : I expected an ignorableWhitespace event at step 2. The XML
    : : document contains repetitive tagnames. The strange thing
    about
    : : the parse process is that the parser splits up the character
    : : data only sometimes, and I can't determine any kind of
    logica
    : : for this behaviour. Most occurrences of exactly the same
    : tagname
    : : and character data are parsed correctly (that is, as I
    : : expected).
    : : Am I dealing with correct behaviour here, or is it a bug??
    : : Rolf.
    : The behavior is expected and correct. Could you elaborate on
    why
    : you would expect the parser to treat the whitespace signalled
    in
    : step 2 as ignorable?
    : Oracle XML Team
    : http://technet.oracle.com
    : Oracle Technology Network
    Thank you for your quick response.
    In my test XML, there are about 27500 tags containing character
    data. All character data starts with a whitespace character.
    After parsing the xml, the whitespace of only 5 (!) tags is
    treated as a seperate character event (so two character events
    are raised in succession). The remaining tags all raise only ONE
    character event for the entire character data. I can't explain
    the difference in treatment.
    null

  • NI VISA USB disconnect​ion events

    I am using NI VISA to control and acquire waveforms from a Tektronix oscilloscope in my application and so far everything works well but sometimes the USB connection can easily disconnect (and then connect immediately) and the MessagedBasedSession object then becomes invalid. My question is how can one setup events to know when a VISA device is connected and disconnected from an application so that these events can be captured and possibly notify the user or reconnect to the instrument. I know there are some functions such as Disable or Enable events but there are little documentation about these functions.
    Thank you.

    Hi falopsy!
    Thank you for contacting National Instruments.
    From what I understand of your problem you have a Tektronix scope connected to your computer via USB and you're communicating with it with the use of the VISA drivers. When the connection drops (briefly) and reconnects again, your MessageBasedSession expires and is no longer useful. I have found a few links that I think might help:
    Firstly, this method here simply detects an error; you can then notify the user of the error and ask them to reconnect.
    http://forums.ni.com/t5/LabVIEW/USB-Serial-VISA-pr​oblem-when-reset-happens/m-p/1442352
    You also mention VISA Events in your post, although I couldn't find a specific event for a connection drop I feel that it may still be of use:
    http://zone.ni.com/reference/en-XX/help/371361J-01​/lvinstio/visa_events/
    Lastly, I have attached an example VI of how to detect a serial break when transmitting data serially, this may also be of use.  It might also be a good idea to swap the USB cable in case this is causing the connection drop.
    I hope this helps! Let me know how these go and if there's anything else I can do - Have a great day!
    Max
    NOTE: If the attachement fails to open, it can be found in LabVIEW under Help>>Find Examples... and searching for "detect serial break".
    Attachments:
    Detect Serial Break Event.vi ‏35 KB

  • Block and character special files

    What is the difference in semantics between block and character special files on Mac OS X?
    In the olden days, character special files were intended for serial character-oriented devices such as teletypes, printers, modems etc. not capable of seeking and block special files were intended for seekable block-oriented devices such as winchester disks etc.
    But nowadays, Apple uses /dev/rdisk* as the raw (unbuffered) hard disk device, and it is a character special file, and it is seekable. /dev/disk* on the other hand, is buffered, slower, and a block character special file.
    Is there still any semantic difference at any O.S. level between these two kinds of special files, or is it all entirely up to the driver designer and it only effectively provides us with one more bit for the device number?

    Hi,
    Is there still any semantic difference at any O.S. level between these two kinds of special files
    As you write, a block device is bufferd by OS, while a character device is not bufferd by OS (=raw device).
    In the olden days, character special files were intended for serial character-oriented devices
    Even in olden days, I guess a seekable mass storage had both block and character devices; the latter is for partitioning, disk diagnose, backup, etc. Only block devices can be mounted.
    Serial (un-seekable) device can only be a character device, I guess.

  • Is there a way to differentiate string containing characters vs. numbers?

    Hello, I am creating an application to read data from a serial port device. The problem is that the device, on startup, outputs a block of text containing characters describing the device. Shortly after, it outputs a command prompt "Command:" It is at this point that I want my VI to input the command to begin taking measurements.
    I was looking at the VISA Wait on Event and it looks like that could be used to wait for the device to output a "Serial Character" but there is no differentiation between letters and numbers that I can tell.
    If the device is outputting numbers in the read string, of course, I do not need to input the command to begin taking measurements again, that will only probably confuse the device. In that case, I would like my VI to continue taking measurements with VISA Read.
    The reason for this is that when I run the application, the device may have already been turned on. Sending that command to the device using VISA Write is unnecessary at that point.
    Any advice would be appreciated. Thanks.
    Solved!
    Go to Solution.

    That makes it alot easier.  In that case this will do the trick.  You'll notice that the bottom case does not match even though it has valid vaules inside of it.  The only thing that will match is if the entire string is of the form XX.XXXX.  By the way, since we are only matching numbers now, you can remove the "ignore case" boolean as it no longer matters.
    Message Edited by SiegeX on 11-24-2008 03:58 PM
    Attachments:
    regex.png ‏4 KB

  • Need a UPS package [solved]

    I've got a APC backup ES 650 which connects via usb and I would like to find something to work with it to turn it off durning power outages. I've looked into openupsmart but I believe that is meant for serial type backups, says /dev/ttyS0 - thats serial right?. Anyways, I looked into apc's website for a linux version and they had a UNIX compatitble. I did a package build and tried to build but kept running into compile errors. I edited the source code about 5 or 6 times getting past the humps until I ran into an error that I couldn't solve. Any suggestions what to do?

    ## apcupsd.conf v1.1 ##
    # for apcupsd release 3.10.15 (04 August 2004) - unknown
    # "apcupsd" POSIX config file
    # ========= General configuration parameters ============
    # UPSNAME xxx
    # Use this to give your UPS a name in log files and such. This
    # is particulary useful if you have multiple UPSes. This does not
    # set the EEPROM.
    UPSNAME emperor
    # UPSCABLE [ simple | smart | ether | usb |
    # 940-0119A | 940-0127A | 940-0128A | 940-0020B |
    # 940-0020C | 940-0023A | 940-0024B | 940-0024C |
    # 940-1524C | 940-0024G | 940-0095A | 940-0095B |
    # 940-0095C | M-04-02-2000 ]
    # defines the type of cable that you have.
    UPSCABLE usb
    # Old types, still valid, are mapped to the new drivers
    # keyword driver used
    # UPSTYPE [ backups dumb
    # | sharebasic dumb
    # | netups dumb
    # | backupspro apcsmart
    # | smartvsups apcsmart
    # | newbackupspro apcsmart
    # | backupspropnp apcsmart
    # | smartups apcsmart
    # | matrixups apcsmart
    # | sharesmart apcsmart
    # *** New driver names. They can be used directly
    # rather than using one of the above aliases.
    # UPSTYPE [ dumb | apcsmart | net | usb | snmp | test]
    # defines the type of UPS you have.
    UPSTYPE usb
    #DEVICE <string> /dev/<serial port>
    # name of your UPS device
    # Here a table of the possible devices related with the UPS drivers.
    # NOTE!!! for USB devices, please use a form indicated below
    # including the [0-15] as written!
    # Driver Device Description
    # dumb /dev/tty** Serial character device
    # apcsmart /dev/tty** Serial character device
    # usb /dev/usb/hiddev[0-15] On most systems
    # net hostname:port Network link to a master apcupsd
    # through NIS
    # snmp hostname:port:vendor:community
    # SNMP Network link to an SNMP-enabled
    # UPS device. Vendor is the MIB used by
    # the UPS device: can be "APC" or "RFC"
    # where APC is the powernet MIB and RFC
    # is the IETF's rfc1628 UPS-MIB.
    # Port is usually 161.
    DEVICE /dev/usb/hiddev0
    #LOCKFILE <path to lockfile>
    # path for serial port lock file
    #LOCKFILE /var/lock
    # ======== configuration parameters used during power failures ==========
    # The ONBATTERYDELAY is the time in seconds from when a power failure
    # is detected until we react to it with an onbattery event.
    # This means that, apccontrol will be called with the powerout argument
    # immediately when a power failure is detected. However, the
    # onbattery argument is passed to apccontrol only after the
    # ONBATTERYDELAY time. If you don't want to be annoyed by short
    # powerfailures, make sure that apccontrol powerout does nothing
    # i.e. comment out the wall.
    ONBATTERYDELAY 6
    # Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
    # the first that occurs will cause the initation of a shutdown.
    # If during a power failure, the remaining battery percentage
    # (as reported by the UPS) is below or equal to BATTERYLEVEL,
    # apcupsd will initiate a system shutdown.
    BATTERYLEVEL 5
    # If during a power failure, the remaining runtime in minutes
    # (as calculated internally by the UPS) is below or equal to MINUTES,
    # apcupsd, will initiate a system shutdown.
    MINUTES 3
    # If during a power failure, the UPS has run on batteries for TIMEOUT
    # many seconds or longer, apcupsd will initiate a system shutdown.
    # A value of 0 disables this timer.
    # Note, if you have a Smart UPS, you will most likely want to disable
    # this timer by setting it to zero. That way, you UPS will continue
    # on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
    # or the remaining battery runtime drops to or below MINUTES. Of course,
    # if you are testing, setting this to 60 causes a quick system shutdown
    # if you pull the power plug.
    # If you have an older dumb UPS, you will want to set this to less than
    # the time you know you can run on batteries.
    TIMEOUT 480
    # Time in seconds between annoying users to signoff prior to
    # system shutdown. 0 disables.
    ANNOY 300
    # Initial delay after power failure before warning users to get
    # off the system.
    ANNOYDELAY 60
    # The condition which determines when users are prevented from
    # logging in during a power failure.
    # NOLOGON <string> [ disable | timeout | percent | minutes | always ]
    NOLOGON disable
    # If killdelay is set, apcupsd will continue running after a
    # shutdown has been requested, and after the specified time in
    # seconds attempt to kill the power. This is for use on systems
    # where apcupsd cannot regain control after a shutdown.
    # KILLDELAY <seconds> 0 disables
    KILLDELAY 0
    # ==== Configuration statements the network information server =========
    # NETSERVER [ on | off ] on enables, off disables the network
    # information server. If netstatus is on, a network information
    # server process will be started for serving the STATUS and
    # EVENT data over the network (used by CGI programs).
    NETSERVER off
    # NISIP <dotted notation ip address>
    # IP address on which NIS server will listen for incoming connections.
    # Default value is 0.0.0.0 that means any incoming request will be
    # serviced but if you want it to listen to a single subnet you can
    # set it up to that subnet address, for example 192.168.10.0
    # Additionally you can listen for a single IP like 192.168.10.1
    NISIP 0.0.0.0
    # NISPORT <port> default is 3551 as registered with the IANA
    # port to use for sending STATUS and EVENTS data over the network.
    # It is not used unless NETSERVER is on. If you change this port,
    # you will need to change the corresponding value in the cgi directory
    # and rebuild the cgi programs.
    NISPORT 3551
    # If you want the last few EVENTS to be available over the network
    # by the network information server, you must define an EVENTSFILE.
    EVENTSFILE /var/log/apcupsd.events
    # EVENTSFILEMAX <kilobytes>
    # By default, the size of the EVENTSFILE will be not be allowed to exceed
    # 10 kilobytes. When the file grows beyond this limit, older EVENTS will
    # be removed from the beginning of the file (first in first out). The
    # parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
    # to zero to allow the EVENTSFILE to grow without limit.
    EVENTSFILEMAX 10
    # ========== Configuration statements used if sharing =============
    # a UPS and controlling it via the network
    # The configuration statements below are used if you
    # want to share one UPS to power multiple machines and have them
    # communicate by the network. Obviously, the master is connected
    # to the UPS via the serial cable, and it communicates to the
    # "slaves" via the network -- i.e. the slaves get their info
    # concerning the UPS via the ethernet.
    # UPSCLASS [ standalone | shareslave | sharemaster | netslave | netmaster ]
    # normally standalone unless you share a UPS with multiple machines.
    UPSCLASS standalone
    # Unless you want to share the UPS (power multiple machines).
    # this should be disable
    # UPSMODE [ disable | share | net | sharenet ]
    UPSMODE disable
    # NETTIME <int>
    #NETTIME 100
    # NETPORT <int>
    #NETPORT 6666
    # MASTER <machine-name>
    #MASTER
    # SLAVE <machine-name>
    #SLAVE slave1
    #SLAVE slave2
    # USERMAGIC <string>
    #USERMAGIC
    # ===== Configuration statements to control apcupsd system logging ========
    # Time interval in seconds between writing the STATUS file; 0 disables
    STATTIME 5
    # Location of STATUS file (written to only if STATTIME is non-zero)
    STATFILE /var/log/apcupsd.status
    # LOGSTATS [ on | off ] on enables, off disables
    # Note! This generates a lot of output, so if
    # you turn this on, be sure that the
    # file defined in syslog.conf for LOG_NOTICE is a named pipe.
    # You probably do not want this on.
    LOGSTATS off
    # Time interval in seconds between writing the DATA records to
    # the log file. 0 disables.
    DATATIME 0
    # FACILITY defines the logging facility (class) for logging to syslog.
    # If not specified, it defaults to "daemon". This is useful
    # if you want to separate the data logged by apcupsd from other
    # programs.
    #FACILITY DAEMON
    # ========== Configuration statements used in updating the UPS EPROM =========
    # UPS name, max 8 characters -- used only during -n or --rename-ups
    #UPSNAME UPS_IDEN
    # Battery date - 8 characters -- used only during -u or --update-battery-date
    #BATTDATE mm/dd/yy
    # The following items are set during -c or --configure
    # Sensitivity to line voltage quality (H cause faster transfer to batteries)
    # SENSITIVITY H M L (default = H)
    #SENSITIVITY H
    # UPS delay after power return (seconds)
    # WAKEUP 000 060 180 300 (default = 0)
    #WAKEUP 60
    # UPS Grace period after request to power off (seconds)
    # SLEEP 020 180 300 600 (default = 20)
    #SLEEP 180
    # Low line voltage causing transfer to batteries
    # The permitted values depend on your model as defined by last letter
    # of FIRMWARE or APCMODEL. Some representative values are:
    # D 106 103 100 097
    # M 177 172 168 182
    # A 092 090 088 086
    # I 208 204 200 196 (default = 0 => not valid)
    LOTRANSFER 106
    # High line voltage causing transfer to batteries
    # The permitted values depend on your model as defined by last letter
    # of FIRMWARE or APCMODEL. Some representative values are:
    # D 127 130 133 136
    # M 229 234 239 224
    # A 108 110 112 114
    # I 253 257 261 265 (default = 0 => not valid)
    HITRANSFER 130
    # Battery change needed to restore power
    # RETURNCHARGE 00 15 50 90 (default = 15)
    #RETURNCHARGE 15
    # Alarm delay
    # 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
    # BEEPSTATE 0 T L N (default = 0)
    #BEEPSTATE T
    # Low battery warning delay in minutes
    # LOWBATT 02 05 07 10 (default = 02)
    #LOWBATT 2
    # UPS Output voltage when running on batteries
    # The permitted values depend on your model as defined by last letter
    # of FIRMWARE or APCMODEL. Some representative values are:
    # D 115
    # M 208
    # A 100
    # I 230 240 220 225 (default = 0 => not valid)
    OUTPUTVOLTS 115
    # Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
    # SELFTEST 336 168 ON OFF (default = 336)
    #SELFTEST 336
    I made alot of changes to the config file, but only that one. Yes I am using the 2.6 kernel with udev.  Everything with (default = 0 => not valid) I set, and stuck with the 'D' settings throughout (has D,M,A,I). Like I said, looking back at my data sheet helped as well as reading through every single setting and adjusting accordingly. My APC is a Back-UPS ES 650 via USB, so I'm sure your settings will vary slightly. I Hope this helps.
    P.S.  still no freezing!   

Maybe you are looking for

  • S Video a or DVI/VGA  out

    I'm connecting to a projector for Keynote presentations and have both an S -Video and a VGA input on the projector. Which input will provide me with the best resolution?

  • Full Project Screen in Premiere Pro 2.0

    Hello, my imported videos do not occupy the full project screen.  They show up as small windows inside the screen.  When the same videos are viewed in Windows Media Player, they play fine (full screen).  The titles that I created in Premiere are fine

  • Draw Circles

    Hi Guys, I need to display one field within circle(means i need to display one filed that field always has the value 'Y' or 'N')in sapscript and in report output also means both normal and alv reports.How can i do this? Is it possible in sap to draw

  • 1 + area code and phone number

    All phone numbers are coming up 1 + area code and phone number. Is there a way to turn off the "1+" and just have area code and phone number?

  • Switching a panel to another panel in the same frame.Is there a better way?

        public void actionPerformed(ActionEvent e) {         if (e.getSource() instanceof toolButton){             westPanel.remove(optionPanel);             westPanel.setVisible(false);             toolButton tb = (toolButton)e.getSource();