How to sync TCP/IP command with data

Hello. I am trying to catch a TCP/PI data and write it to the file. I am using the TCP Communicator example as the base. My goal is to send a command and write to the file the response from the host. Few challenges. I can send multiple commands, but I only want to write to file after specific one and only once. It is the reason I have some logic in the send loop to enable write block. My problem is, by the time data comes, my enable changes value, so I only write the data that was on the bus from previous command. Or, I keep witing to file ove r and over.
What is the best way to sync send a command and wait for the result for this command? Should I just use case structure since I do not need to listen host all the time, only after I sent  commands.
Labview 8.2
Win7
Thank you
Attachments:
TCPIP.PNG ‏71 KB

Do you have control over the data on both ends of the connection? If so, create a simple messaging protocol that will help you keep things in sync and give you the ability to recognize the commands. The simplest protocol would be to define your data packets to contain a message header and data. The message header would contain a message identifier identifier and the message data length. The header should be fixed length. This allows you to easily read the header and the data. The data will be whatever you need for each message type. The header message length will let you know how much data to read. Using this simple protocol the message reading would be very simple. Since each message will contain an identifier you can easily chose how to process the message and what actions you take. If you need to match responses with specific commands you could put a command sequence number in the message header. This would allow you to match the response with the specific command. You would need to include the command sequence number in the response.
If you don't have control over the other side of the connection you will need to get the message format the device uses. That will dictate how to process the messages.
Also, if your system is always a command/response system you do not have to have the read and write in separate tasks. You can send the command and wait for the response immediately afterward. You would not send the next command until you get a reposes. If you know you won't get a response for a specific command you would skip the read.
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

Similar Messages

  • How to declare a bind variable with 'date' data type in command prompt?

    how to declare a bind variable with 'date' data type in command prompt?
    sql>variable q date;
    when i execute it show list of datatypes

    Hi,
    As Lokanath said, there are no DATE bind variables.
    You can use a VARCHAR2 bind variable, and convert it to a DATE in your SQL statment.
    If you're using SQL*Plus, consider a substitution variable. It won't be as efficient as a bind variable, but it will be as convenient.
    For example:
    DEFINE  first_entrry_date = "DATE '2010-06-20''
    SELECT   ...
    WHERE   entry_date >= &first_entry_date
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • In power mac g5, how to take Automatic Screen Shot with Date

    in power mac g5, how to take Automatic Screen Shot with Date ?
    please help me

    If you are standing by, and activating the process by keyboard
    you could be sure to include the open Date Time menu bar
    image in a complete screenshot, using cmd shift 3. Or outline
    the area you want if not full-screen, by using cmd shift 4.
    The command button may also have an apple icon on it.
    So that's the three key shortcuts for full & partial screen.
    For a more automated method, perhaps try using software to
    run an AppleScript, like Automator. Then write a script or find
    one that you can modify to do tasks and test it.
    There may be other methods, however identifying your intent
    would be higher on the list at this time; to narrow the method.
    Good luck & happy computing!

  • How to execute a system command with call executable in teststand 4.2.1?

    Hi All,
          how to execute a system command with "call executable" step in teststand 4.2.1?
          example as i want to quit a application.using "taskkill /f /im xxx.exe".And execute other system command(DOS).
    BR
    Johnny

    Hi, 
    I want to run netstat -an | find "8080" command from command prompt using call executable in test stand. after that i would like take the std output to local variable. 
    Attachments:
    callsettings.jpg ‏404 KB

  • Don't know how to sync music on mac with iphone and ipod

    don't know how to sync music on mac with iphone and ipod
    need to also know how to recover original library of ipod as it seems as though
    it has now sync'ed with iphone & lost all my music

    Start HERE

  • How to transport/move a table with data from development to Test to Production

    Hi,
    How to transport/move a table with data from development to Test to Production..? Export-Import a Delivery Unit does only the structure and not the data
    Reg
    Sri

    Hi Sri,
    You cannot transport Data via Transport route in HANA, you can only transport code changes/Structure via DU. For Data movement, you either have a do a export/import from a flat file or replication from a Source System to HANA.
    Thanks Much,
    Abhishek

  • Does anyone know how to activate siri with a button on a 2011 Chevy Silverado that has blue tooth.  Also I'd like to know how to sync my iphone contacts with this same truck.

    does anyone know how to activate siri with a button on a 2011 Chevy Silverado that has blue tooth.  Also I'd like to know how to sync my iphone contacts with this same truck.

    Hold down the mute button on the steering wheel until you hear,"Ready" and then say "Voice". That will bring up Siri.

  • How to sync outlook 2007 calendar with Iphone 4?

    How do I sync my outlook 2007 calendar with my iphone 4? It used to happen, now it won't work. Thank you.

    Howdy there Connie,
    If your Outlook 2007 is still not syncing to your phone I would like to recommend the following article to help you troubleshoot the Sync Services between your the two devices, named:
    Troubleshooting Sync Services on Windows with Microsoft Outlook 2003, Outlook 2007, or Outlook 2010
    First backup your data, THEN proceed with the articles troubleshooting step by step until it is resolved:
    Back up your data
    Refer to this Microsoft article for steps to back up the data in your PST file used by Microsoft Outlook 2003 or Microsoft Outlook 2007. This Microsoft article explains where the Microsoft Outlook 2010 data files are located.
    For information about backing up the data in your OST file, contact your Exchange Administrator. Your OST file should be on the server and backed up when the server is backed up.
    Before troubleshooting, it is recommended that you make a copy of your iPhone, iPad, or iPod touch backup in a safe place. For more information about where to find the backup and what information it contains, refer to About backups.
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • HT1296 How to sync Notes from iPad with Notes from Outlook 2011 using iCloud

    Have been using iCloud successfully on my iPad and iPhone for photos, documents.  But want to sync the Notes app items from the iPad to my iMac.  Am assuming it would go to Outlook 2011 - but not clear how the sync works.  Or does there have to be a separate App on the iMac for Notes?

    I'm unfamilar with Outlook 365 but you can investigate the iCloud program. See if it'll work over wifi to sync your notes.
    You might also be able to save your notes or export them out of outlook, e-mail them to yourself and then import them from there.

  • How to sync my google calendar with iCloud ?

    To sync my work calendar (that uses outlook) with my iPhone, Is sync my work calendar with my Gmail Calendar so I get my gmail alendar on my iPhone.
    But on my iPhone the gmail calendar is not the account that is linked to my iCloud account.
    So how can copy all my calendar items into my iCloud calendar, so it get synchronised on my MAc ?
    Thanks

    Yes but if set iCloud as my default calendar it wont resolve my problem. Because If I add an item into my Gmail calendar, it will successfully get synch into my iPhone but as it is the gmail cal it won't be ssnch with my mac
    (If I add directly an item into my iphone, it will get synch with my mac)
    So to be clear, is there a way to copy on the fly items inserted from GCal to Icloud cal ?
    add item in my work calendar -> get synch to GCal -> get synch on my iphone GCal -> copy that to iCoud Cal -> get synch through ICloud into my Mac

  • How to sync my google calendar with iphone?

    So my hubby surprised me with an Iphone. But now the hard part is, how to sync my Google calendar, my photos, my contacts from my Samsung Galaxy 3 to my iphone.
    Also, my music from my ipad didn't sync either, nor my photos from my ipad! I'm not thrilled about this.
    Please someone help me!

    Do you have your Gmail set up as an Exchange account?
    http://www.google.com/support/mobile/bin/answer.py?answer=139206
    See also these instructions of syncing with Google Calenders:
    http://www.google.com/support/mobile/bin/answer.py?answer=139206

  • At CRS-1,how can i use show command with pipe | ?

    HI,ALL
    when I use show command with pipe on the CRS-1,the command invalid
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |errors 
                                                                       ^
    % Invalid input detected at '^' marker.
    ========================================================
    But Previously on the cisco 7609,I can use the show command
    GZ-DM-SR-1.MAN.7609#show int | include line |err
    Vlan1 is down, line protocol is down
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 packets output, 0 bytes, 0 underruns
         0 output errors, 0 interface resets
    Vlan11 is administratively down, line protocol is down
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 packets output, 0 bytes, 0 underruns
         0 output errors, 0 interface resets
    Vlan99 is down, line protocol is down
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 packets output, 0 bytes, 0 underruns
         0 output errors, 0 interface resets

    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |errors 
                                                                       ^
    % Invalid input detected at '^' marker.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |?    

    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | |?
                                                                        ^
    % Invalid input detected at '^' marker.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | ?
      begin    Begin with the line that matches
      exclude  Exclude lines that match
      file     Save the configuration
      include  Include lines that match
      utility  A set of common unix utilities
      <cr>    
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |
    % Incomplete command.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |errors
                                                                       ^
    % Invalid input detected at '^' marker.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#                                     
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | ?   
      begin    Begin with the line that matches
      exclude  Exclude lines that match
      file     Save the configuration
      include  Include lines that match
      utility  A set of common unix utilities
      <cr>    
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |?

    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | include er$
    Thu Jan 15 22:36:24.120 GMT
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line           
    Thu Jan 15 22:37:05.013 GMT
    Loopback0 is up, line protocol is up
    Loopback1 is up, line protocol is up
    Loopback6 is up, line protocol is up
    Null0 is up, line protocol is up
    POS0/0/0/0 is up, line protocol is up  (APS not Configured )
    POS0/0/1/0 is up, line protocol is up  (APS not Configured )
    TenGigE0/0/4/0 is up, line protocol is up

  • Calender Sync for Iphone 3G with data from 2 seperate pc's

    Current situation:
    1 IPhone 3G where personal calender and personal contacts are synced via Itunes to my personal PC at home.
    Phone is working on my personal SIM card and is only for personal use...
    'Dream'-situation:
    As I now have 2 phones (1 personal Iphone and 1 Work mobile (nokia) this is what I want to do (but struggeling to get it to work...)
         1. I would switch the SIM cards and use the 'work' SIM card in my iphone (as my work would pay for the phone calls) and I can close the SIM account that i'm paying for - you know, crisis
         2. I would then like to add my 'work' calender from my 'work' pc via Itunes
         3. Then I would also like to add my 'work' contacts
    Now for my questions:
    I know for the calender you can have 2 'calenders'  - but can you also have 2 Contact-groups (similar to the calender accounts?
    Can I then sync the same Iphone with Itunes on my work pc (and only syncing the 'work' calender and/or contacts)?
    Can I then still sync the same iphone with Itunes on, my Home pc (and only sync the 'personal' calender and/or contacts?
    So in both situation, I would connect the Iphone via cable to the PC's (work or personal); but only want to synchronize specific calenders and/or contacts.
    Can I do this with the same apple ID
    And who can help me to set this up - as first trials, just erase everything 'personal' when syncing on the work pc...
    Thanks

    iTunes is not seeing device when connected. It simply freezes (Not Responding) for minutes then fails to see device.
    I have previously uninstalled and re-installed latest from Apple 10.2.2. The only way I got that to work was uninstall AMDS and install version 10.0.1 this worked beautifully for ONE Night only. I am now with 10.2.2 that takes 2-4 minutes to start (non responding half of that time the first half just not shown by task manager) and cannot see device. I tried starting iTunes with devices plugged in and same issues. Windows (Vista 32) does see iPhone.

  • How to sync my macbook pro with my imac?

    I´ve bought a macbook pro and I want to sync data with my imac. How do I do?

    If you mean copy files from one to the other you can connect the two via firewire cable and boot one into Target Disk Mode.

  • How to sync the N900 calendars with the computer?

    Good evening everyone,
    I am a user of the N900 since February 2010 and it's my favorite phone of all the phones that i ever had. I really enjoy every second when i use it
    However, I have a "little" trouble now.
    The touchscreen doesn't respond normally anymore. When I touch it there's no reaction. The Calendar app or the Settings for example don't open. When I touch in the middle for example something completely different opens: desktop configuration. When I slide from one desktop to the other it stops in the middle and goes back to the previous one instead of moving to the next one. Or sometimes there's no response at all and I have to restart the phone, although it doesn't improve anything. I don't know how this happened because the other night I could normally use it, I set an alarm clock. And in the morning I couldn't turn this alarm off because the screen broke down during the night lol :/ what can be done to make the screen work again? Can I do something myself at home or do I have to take it for repair?
    So now I want to make on the laptop a backup of all the data I have on the phone. There was a moment when the screen worked normally again, so I took advantage of this situation to turn on the Bluetooth. I synced most of the data. It's a piece of cake for the pics, videos, contacts and messages. But I am unable to find a way of syncing the Calendar. Ovi Suite doesn't have this option so I tried with Nokia PC Suite. I managed to sync only a part of all the entries I have there :/ I realized that it syncs only the default one ("General" I think it's called in english?). I have 7 other calendars like "Work", "Fun" or "Events". How can I save those calendars on my laptop? Please
    Any advice/help is most welcome! Waiting

    Are you people serious? Sorry for being so direct, but this is supposed to be a help forum for Nokia users. NO ONE is able to give me even 1 solution??????? or at least hints??
    As always I can't count on others for help and have to do everything myself even though I'm not a smartphone geek. After a few days of search I managed to find a way to maybe sync the created calendars. But I have to create a profile in Outlook (what the hell?). Okay, I created a profile in Outlook according to the steps mentioned on a website and I still can't sync the calendars with Nokia Ovi Suite! WHY??? In addition, in the settings of the N900 in "Transfer & Sync" when I want to create a new data transfer profile I can't find my laptop as a device in the Bluetooth search list. I am UNABLE to sync/transfer data. I'll try now with the USB cable...
    PLEASE HELP OUT.

Maybe you are looking for

  • PS CC - Apple error message when 'quitting'.

    Hello Everyone, Your help is needed by a someone starting out with PS. When closing PS I get and error message, 'Could not save Preferences because the file is locked-.' I have read other communities entries and tried changing 'library' (not sure whi

  • I am selling my broken Macbook for parts, how can I erase my old hard drive without the computer working?

    I destroyed my Macbook in a car accident and have found somebody to buy it for parts. To be safe I want to make sure the Hard Drive is void of all personal information before I hand it over. What are my options?

  • Urgent change with unlock tasklist

    Hello everyone, the problem occured to our customer with customizing urgent change. They want import transport request manually through tasklist, but if urgent change is in status "Authorized for Production", tasklist is still locked. I can release t

  • Where do I put my Action Script?

    So, I created a small Flash site with no loading of external swfs. I am strictly using the timeline using labels. I have a layer for my main buttons (home, portfolio and timeline). I have selected AS3 for the file and I have those buttons working fin

  • Excluding characteristic values dynamically during runtime

    Hi guys, I need to do the following for a report I'm trying to create: I have the following Key Figures: "<= 10 days" "> 10 days" I am trying to drilldown by a characteristic value such as Material. So, for the first Key Figure (<= 10 days), I may ge