Send signal to serial port

Hi, I have a trouble.
I need to send a signal to serial port to pilot a relè.
I can't find how to send a Vcc signal for some second on a pin in java.
Someone have an idea?
Thanks a lot!
Edited by: Alberto.Marcigaglia on Aug 29, 2008 2:27 AM

There are many results from the search below:
http://www.google.com/search?q=java+serial+port
I suggest that you use the 3-rd party RXTX package rather than the obsolete javax.comm package. There are a number of very detailled posts in these Sun forums regarding the installation and use of RXTX - search for them.

Similar Messages

  • How send data to serial port from forms 6i

    How send data to serial port to activate hardware connect.
    The hardware is a drawer for cash the point of sales.

    Andres,
    I do the exact thing you are looking for,
    I spool out a text file using text_io
    the file will either contain a double ^G or an epson escape sequence, depending on the drawer type connected.
    I then copy this file to the port using a copy function id d2kwutil
    Works perfectly, but god knows how I'll do it if we want to run the point of sale over the web :)
    John

  • Sending File Over Serial PORT

    Hi,
    I'm able to read/write data over serial port using Java Comm APIs in Linux.
    Can anybody please tell me how to write/read a file over Serial port?
    Is it similar to sending a file over network?
    An early response is appreciated...

    Same stream I/O as used over the port works from a file. Dead simple.
    Also dead slow. If you want to do large amounts of data, use a RandomAccessFile and read a big chunk at a time into a byte array. Then send the byte array.

  • Start a program with a signal from serial port

    Hi, my program need to continue when it's gets a signal from the
    serial port, I've understand that i need to use Java Communications 3.0 API.
    couldn't install it.
    when i import, in my program, javax.comm.* it can't be resolve.
    thank for eny help..:-)

    Glad you got it to work. I would only say 2 very important things:
    1) Do not use an IDE as long as you can't code using notepad and command console and don't understand the concept "classpath". Now you've to learn both the IDE and the Java language basics. This is going to take a longer time than when you learn it one by one.
    2) You should NEVER place any 3rd party libraries in JRE/lib or JDK/bin. This is receipt for major future troubles. You should define the classpath yourself. You shouldn't misuse the default classpath.

  • Asserting the RTS signal for serial ports

    I've posted a few times, about asserting the DTR signal line for the serial
    ports.
    To start off with, i have now come to the realization that I was STUPIDLY
    trying to set the wrong thing... I needed to set the RTS, not the DTR!!!
    Most of the replies I got said to use the IN PORT and OUT PORT vi's, from
    the advanced, memory/portI/O palette.
    When i had a fiddle around with these, and looked them up in more depth, I
    found a few things...
    1. I have read a few times, that these are not portable, because of machine
    dependancy... Can anyone tell me how portable they are? Such as, are they
    fine for all Intel based architechure's, or what
    2. I found that if I initialize the serial port, using the Serial Port
    Init.vi, and then use
    the Out Port.vi, to set the RTS, by addressing the
    register at 0x2FC, for COM 2, the next thing I did, which was write to the
    serial port, hung. When I highlighted execution, it was stuck in the Serial
    Write.vi Can anybody tell me what I'm doing wrong?
    Your help would be greatly appreciated!
    Slade Squire
    Programmer
    Rectifier Technologies Pacific
    Melbourne, Australia
    [email protected]

    You should read replies to your posts more carefully since Craig Graham have
    pointed out that VI to use to assert RTS and DTR lines of a serial port. You
    also should search this group for the RS485 and RTS/DTR topic; it is a
    recurrent question and there are some pitfalls on toggling RS485 direction
    in LabVIEW.
    As for RTS flow control, you will see something only when the input buffer
    of the serial port is full, in which case RTS is asserted to signal the
    transmitter to pause transmission.
    Jean-Pierre Drolet
    "Slade Squire" a �crit dans le message de news:
    [email protected]...
    > Something else I forgot to mention....
    >
    > When I try and set RTS in the flow control parameter of Serial Port
    Init.vi,
    > it doesn't do anything!
    > Why?
    > (I know it doesn't do anything, because I have an oscilliscope set up on
    the
    > end of the com cable, wired to the RTS pin)
    >
    > "Slade Squire" wrote in message
    > news:[email protected]...
    > > I've posted a few times, about asserting the DTR signal line for the
    > serial
    > > ports.
    > > To start off with, i have now come to the realization that I was
    STUPIDLY
    > > trying to set the wrong thing... I needed to set the RTS, not the
    DTR!!!
    > >
    > > Most of the replies I got said to use the IN PORT and OUT PORT vi's,
    from
    > > the advanced, memory/portI/O palette.
    > >
    > > When i had a fiddle around with these, and looked them up in more depth,
    I
    > > found a few things...
    > >
    > > 1. I have read a few times, that these are not portable, because of
    > machine
    > > dependancy... Can anyone tell me how portable they are? Such as, are
    they
    > > fine for all Intel based architechure's, or what
    > >
    > > 2. I found that if I initialize the serial port, using the Serial Port
    > > Init.vi, and then use the Out Port.vi, to set the RTS, by addressing the
    > > register at 0x2FC, for COM 2, the next thing I did, which was write to
    the
    > > serial port, hung. When I highlighted execution, it was stuck in the
    > Serial
    > > Write.vi Can anybody tell me what I'm doing wrong?
    > >
    > > Your help would be greatly appreciated!
    > >
    > > --
    > > Slade Squire
    > > Programmer
    > > Rectifier Technologies Pacific
    > > Melbourne, Australia
    > > [email protected]
    > >
    > >
    > >
    >
    >
    LabVIEW, C'est LabVIEW

  • Signal at Serial Port

    Hello,
    I am receiving signal at the serial port through wireless communicator at a baud rate of 9600. I want to analyze this signal and for that i need to know that what sampling frequency i should use and what is its relation with the baud rate.
    Thanks alot

    Abuzar,
    The sampling rate for your signal is the rate at which the digitizer in the microcontroller takes samples.  If you are trying to get a good reprodcution of the waveform, the sampling rate is probably 300 to 1000 Hz.  If you are anywhere near 1000 Hz sampling, you will not be able to transmit all the data through your 9600 baud link (~ 1 ms per byte).
    Lynn

  • Want to use dotNet with teststand, but unsure how to send commands through serial port

    I have a loCom communication dll used to send and recieve commands through serial comunication for a particular product.  I the past they have used a LabVIEW wrapper to send and recieve commands, using this particular dll.  I would like to just use testStand for the DOTNET Dll.  I can get the commands, know the inputs and outputs required, however I can not figure out how to send the commands to the serial port.  Anyone have any exprience doing this in TesSTand?

    hallawt,
    With your .NET code module, you should be able to call it directly, most likely as a parameter in the .NET method.
    What are the inputs for the method you're trying to use?
    Also, could you clarify where you're starting to have problems in your project?
    Regards,
    Renée M
    Applications Engineer
    National Instruments

  • Send file to serial port using comfromfile

    Hi,
    I am current working on a project with requires to transfer a bin file to the controller, if the file is valid i will get the correct respose.
    if we send a file in hyperterminal using send text file option i am getting response from the controlller as file valid.
    I want to send a file through the code i used comfromfile function i am getting invalid file reponse from the controller even i tried byte by byte with comwrtbyte also i received the same invalid response..
    I cross checked the rs232 configuraiton of both hyperterimal and my code..both are same..even i checked with port sniffer tool to capture the port data..both are same.
    I am not able to find what is the issues with my code. what is the differece in the Hypertemail and CVI functions..
    Regards
    Vikram Kumar P

    Thank you for your support....
    As per policy i cant share my complete code..
    whatever eariler shared code is a part of my application code where the binary data is transfered..there is no issues with formating reading coping.
    I checked the serial data variable before sending the data is correct what expected to send.
    I tried all the serial functions comwrtbyte, comfromfile, comwrt & visa functions..the same behavior is received
    please find the attachment of catured data from portman tool.
    attached 3 files
    hyperterminal captured data - I am getting valid response from controller
    cvi exe captured data - I am getting failed response from controller.
    binary data - downloadable binary file to a flash memory using the RS 232 communication system
    Attachments:
    With CVI applicatoin exe.LOG ‏44 KB
    With hyperterminal.LOG ‏44 KB
    Binary data to transfer.txt ‏1 KB

  • How to set the number of packets to be send per second to the serial port in labview

    hi.
                  i have to send data to serial port such that each packet of data should be send at a rate of 4 packets per second?? how can it be done??
    thanks and regards
    Solved!
    Go to Solution.

    What defines a packet?
    You just need to have a while loop that has a wait timer in it of 250 milliseconds surrounding your VISA write function.

  • Send thru serial port (RS232) the instruction CTRL+"something"

    How to i send thru a serial port (RS232) the instruction "CTRL", like CTRL+"something", im only looking for the special character CTRL, i have seen that it can send a CTRL+A ... CTRL+Z thru a type cast, but  is not what im looking for, im sending a special instruction (CTRL+PQT<package>) thats requires this character.
    reards

    The control key is not something you can send through a serial connection.  It is a modifier key (like Shift and Alt) and not a character that would have an ASCII value associated with it.
    However, many of the special ASCII control characters (those below decimal 32) can often be entered as a CTRL+key combination.  For instance, the beep is ASCII 8 and is also a CTRL-G combination.  The backspace is ASCII 9 and CTRL-H.  CTRL A is ASCII 1 so sending a string set in hex display as 01 or \01 in \codes display would work.
    What is (CTRL+PQT<package> supposed to mean?  Is it Ctrl P followed by Q T then something else?  What equipment are you trying to interface with?

  • Hyperterminal to serial port

    I use the hyperterminal to communicate and send commands to serial port COM1.
    On the hyperterminal window, I used to type such a command:
    AT+ZV SPPCONNECT.......
    This command is sent to the device connected to the COM1 port.
    Now I want to cancel the hyperterminal, and sue a Java program.
    I used the javax.comm library to build a java application that communicates with the COM1 port.
    Inside that program, I connected to the COM1 port. How do I send that text command from inside the java program to the COM1 port. There is a method called (send) inside the (serialport) class, do I just say:
    serialport.send "AT+ZV SPPCONNECT.......".
    I mean, is sending text commands through the hyperterminal simply equivalent to sending those text commands to the COM1 port using the java application described above.
    Message was edited by:
    lrantisi

    I wouldn't see how it could be otherwise.
    Did you try it?

  • Writing bytes to serial port in each iteration of loop

    Hello everyone,
                      Well I am new to labview, my question might of beginner's level but i have searched the forums and didnt find content regarding it. Kindly help me through it as i am really stuck in it for last three days. 
                      I have to make a packet of bytes in each iteration depending upon the bytes i get from array which is input to for loop. Taking five bytes and then making packet according to protocol. Once packet is made i have to send it to serial port in the same iteration. So for each iteration i have to send packet to serial port. I have tried the shift registers, local variables, and also the autoindexing which returns the array at the end of loop. But these things dont solve my problem. Kindly help me solvng this issue.
    Many many thanks in advance
    Engr. Yasir Amin 

    First of all thanks alot for your reply.
                             The problem is that i have made separate subVI for this protocol stuffing and the output of that subVI is attatched to the serial visa write in another main  VI in which i am using this VI. I have sent parameters to subVI which makes the packet and then send the output, the output is then sent to visa serial write. Actually that visa serial write is common to many subVIs, On the interface its user's choice to select the request he wants to send. The based on the request the particular subVI is chosen and then that subVI generates the string which is in main VI. which is written to serial port. All other subVis are working fine becoz they dont have loop they simply make the string and send it to port. But this subVi with the loop has the problem as it sends only the last iteration string to port.
    I cant post the code as i am using my laptop in my room and the code is in office laptop But tomorrow i can share it from office
    Thanks
    Yasir

  • Serial port DATABITS != 8

    Hello,
    I would like to know how Serial Port in java works. I mean, I installed the javax.comm driver in windows and there is no problem.
    However, what happens if I use 7, 6 or 5 bits of data in the serial port? The Java communicactions API provide an Outputstream to send data through serial port. So it only accepts byte [].
    If I configure my serial port with 7 bits of data, how is it sent? I mean:
    it sends only the 7 lower bits of a byte? If DATABITS are set to 5, 6, it sends the 5 or 6 lower bits of the byte?
    Thanks
    bramez

    The number of bits that is defined does not affect the byte representation in Java system. It determines only the number of bits that will represent one byte between the serial port and the device that it will be connected to it , normally external modem will be connected to serial port.
    If the number of bits = 7 , that means that the 8th. bit will be used as a parity so the Parity parameter should be Even or Odd , but if the data bits = 8, there is no parity.

  • How to read serial port and substring

    I am new for labview .I send data from microcontroller with C languange every 1 minute this codeprintf("T%3.2f,H%3.2f",fTemp_true,fRh_true);
    And I read data with Hyperterminal it show this T29.11,H67.88 I want to show 29.11 and 67.88 only and stroe in database. I study connect serial port in example and I have a question. If I use this code.Can I auto read every 1 minute or this code can read 1 time only and I have to click every 1 minute.How to auto read when I send data to serial port with microcontroller every 1 minute. And I cannot substring 29.11 and 67.88 because %3.2f can show T29.11,H67.88 or T129.11,H100 . and  How can I simple send data to database. Thank you . 

    No, you don't have to click run every minute. You just need to place a while loop around the VISA Read. You could use Wait (ms) but it would be better to use something like the Elapsed Time function and wire the time has elapsed output to a case statement with the VISA Read inside the true case.
    This is one way to parse the string:
    If you have the database connectivity toolkit, you can easily write to a database. There is also something called LabSQL.
    Message Edited by Dennis Knutson on 01-22-2010 01:42 PM
    Attachments:
    Parse String.png ‏16 KB

  • How to get a signal from the serial port to start a labview program?

    I need to synchronize the data obtained from a program (which is not in Labview)with the data collected with Labview on a different computer. I can send some data strings to the serial port of the computer running the Labview program when the other program starts. However, I need to be able to read the trigger in my Labview program. Do you know what I should do? Thanks.

    If you don't have any other programs listening on the COM port, you need to let a LV program run BEFORE the signal comes, otherwise you won't be able to read it. You can have the program wait in a slow timed loop so that it doesn't use up too much CPU time, and when the required "trigger" comes, to move into the main part of the program.
    You basically need a while loop waiting for a certain string in the serial buffer. Once the string is found the while loop is exited, and the data acqquisition or whatever else you require from the progam can be performed.
    In the example attached the program wait for ANY text to be sent to the COM port. Please note that you need to configure the VISA resource before using it. Once there is something at the COM port, the loop will exit and the rest of the program will be executed.
    Hope this helps
    Shane
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
    Attachments:
    Wait for serisl message.vi ‏17 KB

Maybe you are looking for

  • Is it possible to run a Save for Web Batch?

    I am trying to run a batch on a bunch of ai files to save them as JPEG using Save For Web & Devices (so they can be saved with certain settings). I record a Save For Web action and then try to run a batch, but the batch just hangs at the Save For Web

  • Incoterms

    Hi all Can some one plese explain me what is 'Terms of Payment' & 'Incoterms' in vendor master record. some scenarios where we need to create new ones other than standard Regards Bhushan

  • Showing various images on browser using JSP and Servlet

    Hello Guys! I am starting to develop in Java and already I am facing a big problem. If somebody will have some tip or suggestion, will be very well comings! The application must present in browser images originnally of format TIF. As it is not a nati

  • EA3500 Smart Wi Fi - How to disable IPV6 to address Parental Control Issue

    Hi I've been reading that parental controls does not work with IPV6. I would like to disable IPV6. How would I do that? P.S.: I noticed responses for EA4500 that there is a check box to disable the IPV6.  Very straight forward but my interface does n

  • Match same calls in different dates

    Hi I want to match calls made to a same number in differnt dates, I think it is with an inner join but I cant make it work. My table is a registry of calls made from several users. Name      Null Type    TIME           VARCHAR2(15) CALLED_NUMBER  VAR