Sending one byte with Rs232 ?

Hello,
I have a device, which works with 1-byte commands.
example:
0xD1 has to be sent, where the high nibble (D) is one of six commands and the low nibble (1) is one of 15 possible addresses.
Commands are: E,C,D,8,5,4
Addresses are: 1-F
There are 90 possible combinations of commands and addresses.
I made a program, where i can choose the command and the address separately, and they will be combined individually in one string, which should be one byte.
Now the problem:
If i send this string via RS232 to a PC-Terminal, i see exakt the same string as in my program.
>> 0x51 should be the combined string and I want to see a "Q" at the terminal but the result is "51".
There are sent two bytes (0x35 and 0x31 for "51") than one 0x51 "Q".
When I make a Stringelement (with property "HEX-Display") and typing in the number (51) directly, i get a "Q" on the terminal.
How can i automate this?
I really spent a lot of time on this problem!

I hope you don't mind, but I took the liberty of modifying the block diagram to make it much more readable, and I got rid of the local variable which is unnecessary. Compare this block diagram to the one using the sequence structures. In this diagram, all of the code is visible at one time. The data flow insures that the funtions will operate in the correct order. This is the preferred method of coding over using sequence structures.
- tbob
Inventor of the WORM Global
Attachments:
RS232testprogi.vi ‏38 KB

Similar Messages

  • Problem sending only one byte with ibwrt()

    If I send only one byte of data with ibwrt() command, it doesn't work with whatever settings (EOS,EOI,..) I chose. I got the error (ENOL : no listener).
    Did somebody get the same problem ?

    ENOL indicates that there is no listener on the bus. This is probably not related to the settings on the controller. Are you correctly addressing a device to be a listener? If so, is there some indication on the device that it is addressed to listen?
    Also, your post seems to indicate that sending more than one byte works. Is this true?

  • Iam unable to send multiple attachments with a mail using JavaMail?

    Hai to all,
    Iam unable to send multiple attachments with a email,see
    iam have succeeded in sending one attachment with a email.
    when iam tring to add two or more attachments to a mail,
    it is giving a Exception like this:
    javax.mail.MessagingException: IOException while sending message;
    nested exception is:
    java.io.IOException: No content
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:577)
    at javax.mail.Transport.send0(Transport.java:151)
    at javax.mail.Transport.send(Transport.java:80)
    at AttachFilesModified.sendMail(AttachFilesModified.java:185)
    at AttachFilesModified.main(AttachFilesModified.java:43)
    this is my code snipnet:
    BodyPart messageBodyPart = new MimeBodyPart();
    Multipart multipart = new MimeMultipart();
    if(body != null)
    messageBodyPart.setText(body);
    multipart.addBodyPart(messageBodyPart);
    /*if(attachments != null)
    for(int i = 0; i < attachments.length; i++)
    String filename="D:\\nagaraju\\apachi\\axis-bin-1_3.zip";
         //String s[]=filename.split("\\");
         //System.out.println(s);     
              //String s1=s[1];
              //String filename1=s[s.length-1];
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(filename);
         messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(filename);
    multipart.addBodyPart(messageBodyPart);
         //second file attaching
         /*String filename1="C:\\nagadoc.txt";
         BodyPart messageBodyPart1=new MimeBodyPart();
         DataSource source1=new FileDataSource(filename1);
         messageBodyPart.setDataHandler(new DataHandler(source1));
         messageBodyPart.setFileName(filename1);
         multipart.addBodyPart(messageBodyPart1);
    mess.setContent(multipart);
    Address[] allRecips = mess.getAllRecipients();
    if(toStdOut)
    System.out.println("done.");
    //System.out.println("Sending message (\"" + mess.getSubject().substring(0,10) + "...\") to :");
    System.out.println("Sending message................");
    for(int i = 0; i < allRecips.length; i++)
    System.out.print(allRecips[i] + ";");
    System.out.println("...");
    Transport.send(mess);
    if(toStdOut)
    System.out.println("done.");
    return 0;
    What's wrng with that code snipnet?
    Nagaraju G.

    This works fine with me, try it or compare it if you want.
    public void sendEmail( String from, String to,
    String subject, String body) {
    fMailServerConfig.put("mail.smtp.host", " <<mail server>>");
    Session session = Session.getDefaultInstance( fMailServerConfig, null );
    MimeMessage message = new MimeMessage( session );
    try {
    message.setFrom(new InternetAddress(from));
    message.setRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    message.setSubject( subject);
    message.setText( body);
    //Adds Attechment:
    Multipart multipart = new MimeMultipart();
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText("Here are my attachments");
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    //first attachment
    DataSource source = new FileDataSource("C:\\img1.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("C:\\Telnor1.jpg");
    multipart.addBodyPart(messageBodyPart);
    //Second attachment
    DataSource source2 = new FileDataSource("C:\\img2.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source2));
    messageBodyPart.setFileName("C:\\Telnor2.jpg");
    multipart.addBodyPart(messageBodyPart);
    //etc...
    message.setContent(multipart);
    Transport.send( message );
    }catch (MessagingException e){
    System.err.println("Cant send mail. " + e);
    The error on your code might be:
    BodyPart messageBodyPart1=new MimeBodyPart();
    DataSource source1=new FileDataSource(filename1);
    messageBodyPart.setDataHandler(new DataHandler(source1));
    messageBodyPart.setFileName(filename1);
    multipart.addBodyPart(messageBodyPart1);
    You don't need to create a new BodyPart, and apart from that you'r seting values on "messageBodyPart" but adding "messageBodyPart1" to your multipart :P
    Well see u and have a good one!
    p.s. i know it's a little late from the day you posted, but at least it might help somebody else :D .

  • How to send multiple files with it's original name over HTTPS using one CC?

    I am working on a File to HTTPs scenario. It is in production and working fine. Currently we send only one file and I have hard coded the name in the communication channel in the header fields. Now we have to send more files with different names and I want to use only one receiver channel instead of many. We need to send the files with their original names.
    I used the ASMA in the sender File Adapter and I see the FileName in the dynamic configuration under http://sap.com/xi/XI/System/File name="FileName".
    I know we can use a UDF in message mapping and get the value and put it in HEADERFIELDONE. But we don't want to use mapping as the files are huge and we don't want to insert XML tags in the payload.
    So how do I put the Filename from the DynamicConfiguration to the HTTP header field as FileName without using mapping? Are there any settings?
    Can I put something in the PROLOG or can I use any other module in the File Sender Adapter or is there any other option?
    Any help is appreciated.
    Thanks
    Sai

    See my blog:
    /people/stefan.grube/blog/2009/06/19/unknown-use-case-of-dynamicconfigurationbean-store-file-name-to-jms-header-without-mapping
    You have to put the configuration in sender channel, as HTTP adapter does not allow modules.
    For the second module, put values related to HTTP adapter.

  • Is there a way to send a message with a photo attached using imessages. I am not able to send a photo to one of my contacts because I am sending the contact a message text messages. I don't want to send contacts text messages. I want to send them iMe

    Is there a way to send a message with a photo attached using imessages. I am not able to send a photo to one of my contacts because I am sending the contact a message text messages. I don't want to send contacts text messages. I want to send them iMessages.

    Kolyei, sorry for the late reply.
    Have your brother create a contact in his phone for himself. Inside his own contact, have him add his phone number and his iCloud address.
    Settings > Messages > Send & Receive Have your brother select both his phone number and email addresses where he would like to receive iMessages.

  • How to send one single mail each time a table is updated with a batch of rows

    Hi!
    I would like to send one mail each time an integrations services inserts a batch of rows. I,ve tested with this code but it sends one mail for each row that is inserted to the table. How to adjust the code below so it only sends one email?
    Br Arne
    CREATE TRIGGER trao_FOBOSTAFKbelopp
    ON FOBOSTAFKbelopp
    AFTER INSERT
    AS
    BEGIN
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'ArneSqlDatabasemail',
    @recipients = '[email protected]',
    @subject = 'Ny förkalkyl',
    @body = 'Hej!
    En ny förkalkyl har registrerats.
    För att titta på den klicka på bifogad länk.
    Hälsningar
    Arne'
    END
    Arne Olsson

    That is because the process is inserting the rows one at a time.
    I would suggest changing your trigger to "log" the changed rows into a table, and then have a process which reads the log and generates the email.

  • How do I email and letter with a picture if I want it to send as one piece, with no attachment? Please help

    How do I send an email with a picture from pages and have it show up with the picture still intact where I have it inserted in the letter? I do not want it to go as an attachment.

    Hi Carol,
    I've read the rule of the commas for modules, but not for tags ... so thought maybe this is why is not working ... but again, I'm just trying to figure it out.
    I'm still confusing about when and how use modules and tags properly.
    I've found this short guide for TAGS that says literaly:
    "Note: Tags are not transferrable and cannot be shared across all modules. Use the specific tags listed with each module as shown below: "
    http://kb.worldsecuresystems.com/134/bc_1342.html?bc-partner
    You may access through your  BC aacount ... search by "Tags - Quick Reference" ... this is a little different that the one from ADOBE site.
    You'll see that the tags can be customizable by modules and not the way you are doing.
    HOWEVER, take a look at another short guide that might give you another options ... I'm gonna try this too.
    This is at http://forums.adobe.com/docs/DOC-2721  .... scroll down until STEP 4 and see some customizations for Product Tags
    I have a similar case like yours .... I want to show discounts and previous prices only on Sale items ... like I do at http://tesonline02.businesscatalyst.com/outerwear/avatar      ... and hide all these for regular items.
    Haven't found a clear tutorial, neither the responses are completly satisfactory... someone told me use the tag_sale and the rest through CSS ... but ... how??? ...  this is so frustrating
    .. have you found a good tutorial?
    I'm trying to find a response for that ...  keep you posted so you may apply it in your case.
    Regards!!
    Eva

  • When I click attach when sending an email with an attachment I get a dropdown that says "single image" or "default multiple". I choose one. Nothing happens as far as offering a choice as to what doc or photo to attach. What do i need to do?

    When I click attach when sending an email with an attachment I get a dropdown that says "single image" or "default multiple". I choose one. Nothing happens as far as offering a choice as to what doc or photo to attach. I continue between the attach and attachment and still nothing .What do i need to do?

    Hmmm, Permissions are messed up somewhere!?
    Can you open to pic say in Preview, select All, Copy, 7 Paste into Mail?

  • HT5622 Why can I send a message with an attached photo to one contact on phone or email and can't to another contact. I can sent message on iPhone still I was using messages on iPad

    Why can I send message on iPad messages to one contact and not send same message with same photo to another contact. I can sent message on iPhone to same contact

    I would guess that the problem contact does not have iMessage turned on. The iPad can only send iMessages not SMS messages (phone text). You can send a message to this contact with your iPhone because your iPhone can send SMS text messages.

  • Why can't I send multiple pictures with my iPad? I can only send them one by one please help.

    Why can't I send multiple pictures with my iPad? I can only send them one by one please help.

    Are you trying to do this from the photos app or from the mail app? Explain in a little detail what is happening when you try to select multiple photos.
    No matter which app you are using, you can try quitting the apps completely and then reboot the iPad and try again.
    Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • LG Ally - sending text message with pic AND audio *2 attachments on one message*

    I can send an audio file via text message... I can send a picture via text message but for the life of me I CANNOT figure out how to send a pic with audio via text message and it's driving me crazy!
    Does anyone know how to do this?

    It order to send a picture and sound in the same message, once you have entered the Create Message step, you choose Insert Slideshow instead of Picture. When you insert a slideshow, you will have the ability to add both a picture and sound file in the same message. 
    Hope this helps! 

  • How to control one server with multiple clients via TCP/IP

    I am wanting to control a single server with multiple clients.  Only one client would be active at a time, so there would be no conflict.  I want to use TCP/IP.  So far, I have programmed a cluster that passes data back to the server with no problems.  The challenge come in when a second client is added to the mix.  I have't been able to figure out how to turn each client on and send the appropriate data and then turn it off so it doesn't keep sending the same data to the server. 
    Here are the things that I have considered and did some preliminary testing, but don't really know how to impliment:
    1.  Send a numeric on the front of the cluster packet that tells the server that data is on the way.
    2.  Send a boolean on the front of the cluster packet to somehow turn the server TCP/IP on.
    The problem I have found is that LabVIEW TCP/IP doesn't like to be turned on and off.  If it doesn't get the data it expects, it goes into a reset mode and that kills the response time.
    Any help?

    You should consider implementing a set of simple one-byte commands that can be sent back and forth between the Server and the Clients. You can base all of these ideas off the example in the Example Finder under Networking >> TCP and UDP called Multiple Connections - Server.
    You will have two loops in the server VI: one to wait for new connections, and one to send and receive data from the existing connections. For instance, after one of the clients connects, it can request control of the server to send data to it by sending the character "R" for request. Every time the send/receive loop of the Server executes, the first thing it can do is to check all the existing connections to see if any of the clients have sent a control request ("R"). If so, it will create a buffer (array) of control requests. This could be in the form of Connection IDs or indexes in the array for a particular Connection ID. Your choice.
    After the Server receives a request for contol, if it is not already under control by another client, then it can send a response to the first client on the control request list. For instance, the server could send the first client a "S" command for send. Note that after the clients send their control request, they should execute a TCP Read and wait indefinitely for the server to respond with the one-byte "S" command. Then, once the client in control is finished sending data to the server, it could send the character "X" telling the Server to release it from control.
    The example I mentioned above already does a similar thing. Note how when a client wants to disconnect, they send the letter "Q". You can see this in the Multiple Connections - Client VI. The Server then checks each individual connection to see if it's received this one-byte command, and if it has, it closes the connection to the client. This is what you would want to implement, but instead of having just one command, you'll have to distinguish between a few and build up a buffer of control requests.
    Finally, if a client does decide to disconnect in your application, they could send the command "Q" just like the example above. At this point, close the connection and remove that Connection ID from the array of connections. You will also have to handle the case that this client was in the request control waiting line when it disconnected, in which case you need to delete it from that array as well.
    This will definitely work for you, but it will take some work. Best of luck!
    Jarrod S.
    National Instruments

  • How do I send an email with an attachment larger than 20mb

    I am using exchange 2013 and I have users that when they send any emails with attachments over 20mb, it fails.
    How do I change the setting to allow up to 30mb attachments in size?  I've googled this, but to no avail.
    In ECP, I looked under mailflow and then rules, but I don't have any rules there. I tried creating one, but I can't because I don't have the enterprise CALs I guess is what it's telling me.
    Any help would be appreciated.
    Dan

    Hello Everyone, I've already tried everything that was suggested, I changed everything to 50 or 60 MB.
    The user settings is unlimited.  For testing, I changed my own account to 100mb.
    Still the same error message.
    [PS] C:\Windows\system32>get-transportconfig
    AddressBookPolicyRoutingEnabled                            
    : False
    AnonymousSenderToRecipientRatePerHour                       : 1800
    ClearCategories                                            
    : True
    ConvertDisclaimerWrapperToEml                              
    : False
    DSNConversionMode                                    
          : UseExchangeDSNs
    EnableJournalArchive                                       
    : False
    ExternalDelayDsnEnabled                                    
    : True
    ExternalDsnDefaultLanguage                                 
    ExternalDsnLanguageDetectionEnabled                         : True
    ExternalDsnMaxMessageAttachSize                            
    : 50 MB (52,428,800 bytes)
    ExternalDsnReportingAuthority                              
    ExternalDsnSendHtml                                        
    : True
    ExternalPostmasterAddress                                  
    GenerateCopyOfDSNFor                                       
    : {5.4.8, 5.4.6, 5.4.4, 5.2.4, 5.2.0, 5.1.4}
    HygieneSuite                                               
    : Standard
    InternalDelayDsnEnabled                                     :
    True
    InternalDsnDefaultLanguage                                 
    InternalDsnLanguageDetectionEnabled                         : True
    InternalDsnMaxMessageAttachSize                            
    : 50 MB (52,428,800 bytes)
    InternalDsnReportingAuthority                              
    InternalDsnSendHtml                                        
    : True
    InternalSMTPServers                                        
    JournalingReportNdrTo                                      
    : <>
    LegacyJournalingMigrationEnabled                           
    : False
    LegacyArchiveJournalingEnabled                             
    : False
    LegacyArchiveLiveJournalingEnabled                          : False
    RedirectUnprovisionedUserMessagesForLegacyArchiveJournaling : False
    RedirectDLMessagesForLegacyArchiveJournaling                : False
    MaxDumpsterSizePerDatabase                                 
    : 33 MB (34,603,008 bytes)
    MaxDumpsterTime                                            
    : 7.00:00:00
    MaxReceiveSize                                             
    : 60 MB (62,914,560 bytes)
    MaxRecipientEnvelopeLimit                                  
    : 5000
    MaxRetriesForLocalSiteShadow                               
    : 2
    MaxRetriesForRemoteSiteShadow                               :
    4
    MaxSendSize                                                
    : 60 MB (62,914,560 bytes)
    MigrationEnabled                                           
    : False
    OpenDomainRoutingEnabled                                   
    : False
    RejectMessageOnShadowFailure                               
    : False
    Rfc2231EncodingEnabled                                     
    : False
    SafetyNetHoldTime                                          
    : 2.00:00:00
    ShadowHeartbeatFrequency                             
          : 00:02:00
    ShadowMessageAutoDiscardInterval                           
    : 2.00:00:00
    ShadowMessagePreferenceSetting                             
    : PreferRemote
    ShadowRedundancyEnabled                                    
    : True
    ShadowResubmitTimeSpan                                      :
    03:00:00
    SupervisionTags                                            
    : {Reject, Allow}
    TLSReceiveDomainSecureList                                 
    TLSSendDomainSecureList                                    
    VerifySecureSubmitEnabled                                  
    : False
    VoicemailJournalingEnabled                                 
    : True
    HeaderPromotionModeSetting                                 
    : NoCreate
    Xexch50Enabled                                    
             : True
    [PS] C:\Windows\system32>
    [PS] C:\Windows\system32>get-receiveconnector | fl maxmessagesize
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    MaxMessageSize : 50 MB (52,428,800 bytes)
    [PS] C:\Windows\system32>
    [PS] C:\Windows\system32>get-sendconnector | fl maxmessagesize
    MaxMessageSize : 60 MB (62,914,560 bytes)
    MaxMessageSize : 65 MB (68,157,440 bytes)
    [PS] C:\Windows\system32>
    [PS] C:\Windows\system32>get-transportconfig | fl externaldsnmaxmessageattachsize
    ExternalDsnMaxMessageAttachSize : 50 MB (52,428,800 bytes)
    [PS] C:\Windows\system32>
    [PS] C:\Windows\system32>get-transportconfig | fl internaldsnmaxmessageattachsize
    InternalDsnMaxMessageAttachSize : 50 MB (52,428,800 bytes)
    [PS] C:\Windows\system32>
    [PS] C:\Windows\system32>get-transportconfig | fl maxsendsize
    MaxSendSize : 60 MB (62,914,560 bytes)
    [PS] C:\Windows\system32>
    Is there any other setting you want to see?  Is there another configuration change I missed?
    Dan

  • What classes should I use to send/receive bytes inmediately?

    What classes should I use to send/receive bytes inmediately? I mean, without using any buffers or whatever (I will implement this on my app), just the faster method.
    Is InputStream/OutputStream the lowest level choice?
    Thanks!

    Hi!
    Thank you very much for your help, I appreciate it a lot.
    While I test my server, I execute ping www.myclienthost.com -t (my client games are in other office, in the same building, but different ISP) and I don't see anything strange, so I guess network is working perfectly. However, if I use wireshark (sniffer) and I see that my system fails (server does not send acks so client disconnects) is because my acks messages are not sended for 6 o 7 seconds (it should send them every 2 or 3). It seems thread is blocked. and after 6 or 7 seconds one message with 2 or 3 acks together is sent. So, I see that the thread handler blocked for a few seconds and this is doing my server is failing. Why client handler thread on my server is blocked? One question: every 2 or 3 seconds I have a thread that uses sleep that iterates thru client handlers and takes OutputStream and send one ack message for every client handler. My question is, in client handler class I have a method called SendInfo(String whatever) which encrypts and sends through OutputStream, should I protectd this method from accesing from two threads??? as acks thread and client thread can access at the same time. Could this be the problem??
    EDIT: In my previous post I forgot to say what I found out with wireshark. Here I explain it. Sorry.
    By the way, how can I debug threads?? I would like to know if my client thread is blocked in that critical moment.
    Thanks a lot for your ideas and sorry for my English.
    Edited by: Ricardo_Ruiz_Lopez on Jan 22, 2009 7:38 AM

  • Sending binary data over RS232 without conversion to ascii

    I need to send binary data to a PIC without the data being converted to ascii. With the VISA vi's, when I want to send 11111111, it gets converted to a string "255", and is sent as "2","5","5" in ascii.
    How can I send it as one byte?

    r_keller wrote:
    @tbob: I probably shouldnt tell my customer that he's an idiot, and obviously 9 bit addressing/signalling modes seem to be not so uncommon in industry, so ur post does not really contribute to solve the problem.
    Well I wouldn't call my customer an idiot either.  I didn't know he was your customer.  Sorry.  Not every comment posted here is intended to directly solve a problem.  We are a fun loving group, and occasional ribbings take place here.  I still think that trying to use 9 bits over an 8-bit protocol is not a good way to go.  But if it is the only way, then so be it.
    r_keller wrote:
     Does the Mark or Space parity bit add another 10th bit to the command or can i only use either ODD parity/Mark/Space?
    According to the link you attached, the parity bit adds only one more bit.  If the number of bits is set to 8, then the parity is the 9th bit, and you can only use Mark or Space to force that 9th bit to either 1 or 0 respectively.  If you try to use odd or even parity, the protocol will determine the parity and change the bit accordingly, and it may not be the one you intended to send.  The start and stop bits are fixed by the protocol and cannot be used for extra data bits.
    Actually, until I read that article about using Mark and Space, I had no idea at all that sending 9 bits at a time was possible.
    - tbob
    Inventor of the WORM Global

Maybe you are looking for