[LabWindow​s] tcp/ip hexa

Bonjour
J'ai besoin d'envoyer / recevoir des requetes pour le protocole TCP / IP en utilisant LabWindows.
Mes requetes sont sous forme de chaînes hexadécimales: '00, 00, 01, 02, 00, FF, 00'.
Dans l'exemple donné par LabWindows, les données sont envoyées à une chaîne de caractères.
J'ai donc inseré un convertiseur Hexadécimal en ASCII.
Le souci est que quand je dois envoyer le caractere "NUL" ou soit 0x00 en hexadécimal,
mais il n'est tout simplement pas envoyé.
En gros quand je veux envoyer '00, 00, 01, 02, 00, FF, 00' j'envoie en faite: '01, 02, FF'.
Avez-vous une idée de comment je pourrais envoyer ce type de requete ?
D'avance, merci.
Antelme P. S.
Esque les fonctions d'émission / réception sera facilement intégré pour créer une DLL dans TestStand?
Parce que les fonctions sont appelées dans le CALLBACK je me demande si il est compatible.
Résolu !
Accéder à la solution.

Bonjour Antelme,
Merci d'avoir posé votre question sur le forum National Instruments.
Je vous invite à lire l'article suivant : http://digital.ni.com/public.nsf/allkb/46DE184C803​AB1A086256A370078ADF2
Ce document vous informe comment envoyer des caractère ASCII qui ne sont pas affichables comme le caractère null par exemple.
Pour votre deuxième question, TestStand inclut un dll adapter qui permet d'appeller celles-ci facilement à travers vos séquences.
Romain P.
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
>> NIDays 2011, le mardi 8 février au CNIT de Paris La Défense

Similar Messages

  • Connect Labwindows to third party OPC client by datasocket

    Hi
    I have a computer that collect RTUs data through GPRS with Labwindows (simple TCP socket) and aving them. I want to use this data in a third party SCADA application by using third party OPC client. Actually I want to use datasocket to send data to datasocket OPC server (publisher is labwindows) and third party OPC client read it by connecting to datasocket OPC server.
    1. The question is is it possible at all?
    2. Which OPC server in Datasocket I should choose? ( DaqOPC, OPCDemo, OPCFieldPoint,...)
    Sorry if they were basic questions.

    Naderus,
    While I dont know all of the caveats that may come with a few of the acronyms in there, in general, you absolutely can use datasockets via an OPC server. Probably the easiest to use are network shared variables (which are an OPC server). I did notice you had another thread going here. Did you have any luck with the examples and help files they forwarded you to there?
    Regards,
    Kyle Mozdzyn
    Applications Engineering
    National Instruments
    Regards,
    Kyle M.
    Applications Engineering
    National Instruments

  • How often is TCP_DATAREADY generated?

    What I'm doing:
    I'm working on adding a Wi-Fi module to a product that uses a small embedded micro-controller.
    The micro operates as a TCP server communicating via Wi-Fi.
    I've developed a LabWindows/CVI application to display the data that the micro collects.
    In one mode of operation the micro delivers a continuous stream of 20 byte frames.
    The frames are sent at 3200 Hz.
    The LabWindows/CVI code connects to the micro as a client and then sends a command to start the 3200 Hz stream of frames.
    In the TCP callback function (the one that is registered with the call to ConnectToTCPServer(...) )the TCP data is read and handed off to the rest of the application.
    The problem:
    The TCP callback where it handles the TCP_DATAREADY case is not called often enough to keep up with
    the stream of data.  ( I am calling ProcessSystemEvents() in the loop that waits for data)
    My questions:
    How often can I expect to get a TCP_DATAREADY in the TCP callback?
    How much buffering of the incoming TCP data is there?
    In other words how long can my code be "away" from the callback before things get too backed up?
    One other thought:
    Everything has been working well using a directly connected serial interface running at 2 mega-baud
    to connect to the micro.  With the serial connection there is large buffer on the COM port so I have
    a fairly long time before the code has to get back to process more incoming frames.  I'm trying to
    emulate this same behavior with the TCP client-server setup.
    Any ideas will be appreciated, thanks,
    Kirk

    Hi kirkm,
    I was able to do a little digging and did find an available knowledgebase article on this particular flag. You can find it here
    http://digital.ni.com/public.nsf/allkb/C5CC85D98C771FC78625768500565FAF
    It appears the TCP_DATAREADY event of a callback still requires a call to ClientTCPRead. In that function you can specify your data buffer size. That could be one approach to making sure you get the data needed, by specifying your given buffer size.
    Reading up on TCP Communication found at http://www.ni.com/white-paper/3067/en There is a section on how to react to the streaming nature of TCP. I will quote that section for reference:
    "In TCP, because data is sent in a byte stream, it is not possible to know how many bytes are present in the data stream. Therefore, you cannot query the LabWindows/CVI TCP Support Library to get the amount of data available. When you call ServerTCPRead or ClientTCPRead, the library returns the number of bytes read into the data buffer. If the number of bytes read is the same as the data buffer size, then more data still might be present in the data stream. You can read the remaining data immediately by calling the read functions again or wait until the TCP callback is called again with the TCP_DATAREADY event. The LabWindows/CVI TCP Support Library calls the TCP callback with the TCP_DATAREADY event whenever events are processed and there is data in the TCP stream. Refer to the LabWindows/CVI samples\tcp\message.cws sample program for code that shows how to read all the data in the TCP stream whenever the TCP callback receives a TCP_DATAREADY event. The ServerTCPWrite and ClientTCPWrite functions return the number of bytes written to the TCP stream, which might be less than the number of bytes in your data buffer. You must check for this condition and make sure all the bytes in your data buffer are written out successfully. The following code, based on code in the samples\tcp\messagewriter.c sample file, demonstrates how to check for this condition."
    Hopefully that will get things started.
    Regards,
    James W.
    Applications Engineer
    National Instruments

  • Modifying an ssl-proxy-list

    Hi,
    I have 1 ssl-proxy-list with 3 virtual ssl servers defined. I also have the ssl-proxy-list added to several services. I need to add the following to each of the 3 servers:
    ssl-server 3 tcp server window 40960
    ssl-server 3 tcp virtual window 40960
    Sample of existing ssl-proxy-list:
    ssl-server 3
    ssl-server 3 rsakey DATA-test-su
    ssl-server 3 rsacert DATA-test-su
    ssl-server 3 vip address 10.1.5.14
    ssl-server 3 cipher rsa-with-rc4-128-md5 10.1.5.14 88
    ssl-server 3 urlrewrite 3 *
    ssl-server 3 ssl-queue-delay 0
    ssl-server 3 tcp virtual nagle disable
    My questions:
    1. When I suspend this list, is it best practice to do "no ssl-proxy-list LIST", modify in a notepad and re-paste or just add to each server ? and then re-activate (active) ?
    2. Do the order of the items in list matter, like in an ACL ?
    3. Will I require removing and re-adding it to each and every service that has it defined ?
    3. Due to the rsakey and rsacert, will this change require a reboot of the CSS ?
    Thank you in advance !!!
    M

    The frame below, sent by the client 2 minutes and 64 seconds later, has values of 40 and 01 for the same fields.
    - - - - - - - - - - - - - - - - - - - - Frame 945 - - - - - - - - - - - - - - - - - - - -
    Frame Status Source Address Dest. Address Size Rel. Time Delta Time Abs. Time Summary
    945 [161.44.175.145] [208.184.140.161] 153 0:02:35.533 0.001.228 10/19/2001 04:00:09
    PM TCP: D=443 S=3464 ACK=1374357434 SEQ=105608315 LEN=99 WIN=9520
    ----- DLC Header -----
    DLC:
    DLC:
    DLC: Frame 945 arrived at 16:00:09.5404; frame size is 153 (0099 hex) bytes.
    DLC: Destination = Station Cisco107AC01
    DLC: Source = Station Xircm2229D27
    DLC: Ethertype = 0800 (IP)
    DLC:
    ----- IP Header -----
    IP:
    IP:
    IP: Version = 4, header length = 20 bytes
    IP: Type of service = 00
    IP: 000. .... = routine
    IP: ...0 .... = normal delay
    IP: .... 0... = normal throughput
    IP: .... .0.. = normal reliability
    IP: .... ..0. = ECT bit - transport protocol will ignore the CE bit
    IP: .... ...0 = CE bit - no congestion
    IP: Total length = 139 bytes
    IP: Identification = 63628
    IP: Flags = 4X
    IP: .1.. .... = don't fragment
    IP: ..0. .... = last fragment
    IP: Fragment offset = 0 bytes
    IP: Time to live = 128 seconds/hops
    IP: Protocol = 6 (TCP)
    IP: Header checksum = 53C8 (correct)
    IP: Source address = [161.44.175.145]
    IP: Destination address = [208.184.140.161]
    IP: No options
    IP:
    ----- TCP header -----
    TCP:
    TCP:
    TCP: Source port = 3464
    TCP: Destination port = 443 (Https)
    TCP: Sequence number = 105608315
    TCP: Next expected Seq number= 105608414
    TCP: Acknowledgment number = 1374357434
    TCP: Data offset = 20 bytes
    TCP: Flags = 18
    TCP: ..0. .... = (No urgent pointer)
    TCP: ...1 .... = Acknowledgment
    TCP: .... 1... = Push
    TCP: .... .0.. = (No reset)
    TCP: .... ..0. = (No SYN)
    TCP: .... ...0 = (No FIN)
    TCP: Window = 9520 --------------- > this line is of your interest
    TCP: Checksum = E691 (correct)
    TCP: No TCP options
    TCP: [99 Bytes of data]
    TCP:
    ADDR HEX ASCII
    0000: 00 00 0c 07 ac 01 00 80 c7 22 9d 27 08 00 45 00 | ......"'..E.
    0010: 00 8b f8 8c 40 00 80 06 53 c8 a1 2c af 91 d0 b8 | [email protected],
    0020: 8c a1 0d 88 01 bb 06 4b 74 7b 51 eb 07 ba 50 18 | ...Kt{Q.P.
    0030: 25 30 e6 91 00 00 80 61 01 03 01 00 48 00 00 00 | %0..a....H...
    0040: 10 8f 80 01 80 00 03 80 00 01 81 00 01 81 00 03 | ..........
    0050: 82 00 01 00 00 04 00 00 05 00 00 0a 83 00 04 84 | .............
    0060: 80 40 01 00 80 07 00 c0 03 00 80 00 00 09 06 00 | @...........
    0070: 40 00 00 64 00 00 62 00 00 03 00 00 06 83 00 04 | @..d.
    Hope this will bring some useful information to you regarding your case.
    Still if you want to discuss any thing in this regard kindly revert back me.
    I will be very happy if I can be part of any further assistance.
    Please do not hesitate to revert back any time.
    Till then ,
    Kind Regards,
    [email protected]

  • Datasocket 64 bit

    I would like to build and run my CVI application as a 64 bit exe. However it uses datasockets, so I cannot. Are there any plans to support datasockets for a 64 bit application ??  If so, when ?? And if not, what are the alternatives ?? (I'm thinking replacing the datasocket connection with TCP).

    Hello hjb,
    Currently, the DataSockets library is only compatible with 32 applications. However, you could use LabWindows/CVI TCP support library to develop your application. This library is compatible with both versions.
    Carmen C.

  • TCP using LabWindow/CVI ? ?

    Hi !
    I'm looking for ways to learn & use "TCP" communication ( Client /
    Server ) together with LabWindows/CVI.
    ( all examples at your site are for LabView only )
    Can you please let me know where to find an TCP Client / Server
    applications examples for LabWindows/CVI ??
    If posible i'll like the exact addresse of pages contains this
    examples/information !
    Also if posible i like to know if there is something about Ethernet or /
    and Lan ( Local Area Network ) in the LabWindows/CVI.
    I want to add that i know about the TCP Client/Server example in the
    LabWindow/CVI - Samples, but it is not complete - it is only a skeleton
    which not explain
    it all.
    I also want to know about the hardware i need to establishes a TCP
    connection !!
    Which cable should i use to connect the Server & Client computers ?
    Where exactly should i connect the cable in the computer ?
    It very importent for me to get full answer as soon.
    Thank you very much !!
    Regards
    Noam G.

    I would also like to see these examples, but I can help you on some of this. You don't really need any hardware (since you are accessing this site, I assume you have an ethernet card). For a cable, if you are connecting both computers to a LAN or the internet (direct or via a hub) use a RJ-45 ethernet cable. If you are connecting the computers directly to each other, you must use an ethernet crossover cable. The cables just connect into your ethernet port (where your internet access is plugged into now).
    Go here for more info on a crossover cable:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/38528df7b4d1feae86256dcf0069b14d?OpenDocument
    Derek

  • Removing TCP hex codes from ascii string

    I have a TCP connection to my VI and I'm using PuTTY to communicate with it. It is a basic terminal with a few commands. On boot my first command is always unrecognized because a few TCP protocol's are sent immediately beforehand:
    FF FB 1F “window size”
    FF FB 20 “terminal speed”
    FF FB 18 “terminal type”
    FF FB 27 “Telnet Environment Option”
    FF FD 01 “echo”
    FF FB 03 “suppress go ahead”
    FF FD 03 “suppress go ahead”
    Each command is always proceeded by a command character "FF". I can remove the entire offending sting without any problem, however what I've been trying to do is remove any hex code following the command character. I have tried a few things with regular expressions without much luck. Any insight on how to solve this challenge would be appreciated!
    Thanks,
    Devin 

    I'm not a regular expression power user, but I'd try something like the code below (right-click on "Search and Replace String" to set the "Regular Expression" option). This code looks for \FF followed by either \F0 through FA, or \FB through \FE followed by any other character, which I think matches the rules in the Telnet protocol as listed here: http://tools.ietf.org/html/rfc854 It replaces any match found with an empty string.

  • TCP Comm to send Hex data

    I have an embedded device server which has a set of 8 user controllable pins. The command format for  these pins requires a TCP message that is 9 bytes long and in the Hex format.
    I am using the TCP Communicator-Active.VI in the LV7.1 examples, to link to the device server. There is no problem with the connection - but I am unable to send the required message in HEX format.
    The communicator always converts my entry into ASCII and the command thus fails. Also it fragments the typed command bytes and when I probe the resultng data packet with a network analyzer ( Ethereal ) I see that the VI has fragmented the data bytes into many discrete packets.
    The command message that I want to send is in this format : 1B FF 00 00 00 FF 00 00 00
    Any suggestions to resolve the problem ??
    Thanks
    Raghunathan
    LV2012 to Automate Hydraulic Test rigs.
    Solved!
    Go to Solution.

    You need to either create your string in hex display mode so you know you're entering hex values, rather than characters, or use a byte array and then use the Byte Array to String function. I would opt for the latter since it's easier to understand.
    Note that the array is an array of U8 integers with the formatting set to Hexadecimal, and using a minimum field width of 2 characters, zero-padded on the left, and with the radix displayed. Makes it more clear that it's a hex value.
    Message Edited by smercurio_fc on 10-07-2008 01:36 PM
    Attachments:
    Example_VI_BD.png ‏2 KB

  • Labwindows tcp client to generic server

    I made a program fom the client sample in the TCP sample folder. Now I want that program to communicate to a generic server that doesn't have labwindows running on it. Is this possible with just a few minor edits or do I need to start from scratch with a different sample program?
    Solved!
    Go to Solution.

    I see, but I can't understand why it reports no error! The macro exits for return value <0: if directly passed to GetTCPErrorString should not return a "no error" string, neither should GetTCPSystemErrorString do.
    Are you sure you are not calling any other TCP library function before decoding the error? If this other function succeeds, it masks out the previous error.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • The TCP/IP Write Function is transmitting Hex data as ASCII; E.g. 5 bytes of Hex (010518001E)and TCP/IP transmits 10 bytes in ASCII(30 31 30 35 31 38 30 30 31 45).

    Our TCP/IP Server sent a 8 binary bytes (a float number) and from our TCP/IP Client, we try to convert it back into a float number ... but failed. We did try to use the same sample in com./TCP/IP also use type cast but failed the same! Some one can help us? Thanks
    Attachments:
    Test_TCP_IP.vi ‏45 KB

    Sorry guys, It is me ATC ... by mistakes the I did post with wrong title messages! Please ignore the title ... read the detail & attachement!
    Thanks for understanding (I could not remove my post questions)

  • TCP client server sample

    All,
    This may not really be a LabWindows/CVI question but I'm really stuck on what should be easy to
    solve. The brain trust here on the forums has always been helpful so I'll try to explain.
    The project:
    Get LabWindows/CVI code talking to a muRata SN8200 embedded WiFi module.
    The setup:
    (running Labwindows/CVI 2009)
    Computer 1 -- (with a wireless NiC) running simple demo TCP server program provided by muRata.
    Computer 2 -- USB connection (virtual COM port) with simple program (also provided by muRata) that talks to the SN8200 embedded WiFi module.  This code along with the module creates a simple TCP client.
    Whats working:
    I can successfuly get the Computer 2 client connected to and talking to the Computer 1 server. (using the muRata supplied code)
    I can also run the LabWindows/CVI sample code from (\CVI2009\samples\tcp), server on computer 1 & client on computer 2 and they talk with no problems.
    (I'm using the same IP addresses and port numbers in all cases)
    Whats NOT working:
    Run the CVI server program on computer 1.
    I cannot get the muRata client program  to connect to the CVI server.
    I also tried get the CVI client program to connect to the muRata server.  No luck that way either. The CVI client sample program trys connect, and this function call:
    ConnectToTCPServer (&g_hconversation, portNum, tempBuf, ClientTCPCB, NULL, 5000 );
    returns with a timeout error code (-11).
    What I need:
    Some ideas on how to get this working.
    Is there something unique about the LabWindows/CVI sample client/server demo code that would make them incompatible with the muRata code?
    Can you think of some ways I can debug this further?  I feel like I'm kind of running blind.
    What else can I look at?
    For those that have read this far, thanks much and any ideas or comments will be appreciated,
    Kirk

    Humphrey,
    First,
    I just figured out what the problem is:
    When I was trying to use the CVI sample server I was entering the wrong port number.
    The reason I entered the wrong port was because the hard-coded port number in the muRata demo code was displayed in hex as 0x9069. ( I converted this to decimal and entered it into the CVI sample server code) The correct port number was 0x6990.  (upper and lower bytes swapped)  Arrgh!
    I found the problem by using the netstat command line utility to display the connections and noted that the port being used was not 0x9069.  It is really a problem with the muRata eval kit demo code.
    Second,
    Humphrey you are right about the CVI sample code not handling all the muRata commands for the client end of the connection that communicates with the SN8200 module.  For my test I was using the muRata code for that "end".
    The server end is simple and the CVI sample is adequate and is now working.
    Thank you to all who took the time to browse my questions,
    Kirk

  • Software Development Engineer positions at Hysitron, Inc. in Minneapolis (LabWindows CVI exp preferred)

    Software Development Engineer
    Hysitron, Inc. is a premier scientific instrument manufacturer. Founded in 1992 with headquarters located in Eden Prairie, MN we are committed to promoting nanotechnology by developing advanced transducer and control technology. This leadership has made Hysitron the world leader in nanomechanical test instruments. The TriboIndenter®, TriboScope®, Ubi, and other Hysitron innovations have opened new horizons for scientists interested in investigating and understanding mechanical properties of materials at nano-scale. Hysitron fosters an environment and culture where innovation flourishes, teamwork is encouraged, and superior performance is rewarded.
    Hysitron invites applications for multiple software development engineer positions from those aspiring to explore and succeed in the nano world. Hysitron, Inc. is an Equal Opportunity Employer M/F/D/V
    Job responsibilities
    The software development engineers would be responsible for developing test and measurement software applications for nano-mechanical testing instrumentation. Job deliverables would include:
    -          Develop software applications in C based Labwindows CVI for Hysitron Instrumentation
    -          Support the development of applications to address challenges in instrument automation and control
    -          Test software applications using debugging and simulation tools
    -          Perform software releases and software quality assurance activities
    -          Participate in the design of new software products
    -          Perform maintenance activities for existing products
    -          Adapt and deliver on quality software development practices
    Minimum qualifications
    -          BS in Computer Science/ Computer Engineering/ Equivalent Scientific or engineering discipline
    -          Min of 3 yrs experience in Instrumentation software development in an industrial or R&D environment
    -          Expert at programming language C, knowledge of C++
    -          Working knowledge of various communication protocols, e.g. USB, RS232, IEEE, RS485, TCP/IP, Modbus
    -          Knowledge of general software design/documentation processes in test and measurement systems
    -          Proficient problem solving skills
    -          Strong analytical and technical skills
    -          Excellent communication and interpersonal skills
    Preferred Qualifications
    -          Proficient with LabWindows CVI and XML
    -          Working experience with DSP(Code Composer Studio) and/or FPGA level programming
    -          Exposure to digital electronics and instrumentation
    -          Working experience in Robotics interface programming
    -          Experience with Controls/Automation engineering
    Application and Information
    Qualified candidates should send a letter of application and their resumes to (please include ‘SW Engineer’ in subject line):
    Hysitron, Inc.
    10025 Valley View Rd
    Eden Prairie, MN 55344 USA
    Phone: (952) 835-6366
    Fax: (952) 835-6166
    E-MAIL: [email protected]
    Web: www.hysitron.com

    This position is still accepting resumes/CVs.

  • TCP/IP connection with external device

    Hi,
    I need establish TCP/IP connection to my hardware device which has ip(10.102.20.90) and port no as 9012 by setting static ip.
    Since i am new to this protocol i am bit worried about how to make communication between my pc to hardware. Here my labwindow code act as clinet and hardware as server. after establishing successful connection i need to read the data coming out from that port.
    Please help me in making this communication happens.
    i am working on Labwindow 9.0 version.
    Solved!
    Go to Solution.

    A good starting point would be to look at the TCP/IP client sample application that ships with CVI. You'll find it at <CVI Folder>\samples\tcp\client.cws
    Martin.
    Martin
    Certified CVI Developer

  • Problem:100 % cpu usage with tcp server dll

    Hello,
     I am trying to write a dll with labwindows/cvi that allows me to create a TCP Server. This dll is integrated in labview.I created this Dll with example provides by Labwindows/cvi(rtserver.dll).
    Description of my problem: when i execute this dll in a "While Loop" in labview,the TCp server wait a connection and 100% cpu usage occurs. However when a client is connect to the server,the CPU is normaly used because the program stop when he meets the timeout of the tcpread() function. I would like to know how i could limit CPU usage  when the server is awaiting a client in the labview "While loop".
    I know I could use a DELAY() to limit Cpu usage ,but I would like to know if there are any others solutions.
    thank you.

    i dont know your exact application, but i generally use Q to transfer data to TCP loop in my prgram it helps me in two ways.
    1. it automatically restricts the iteration when ther is no data (Less CPU Usage, Less Unnecessary Trafic)
    2. Q can eliminate problems arising due to non synchronization of loop
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog

  • Labwindows/CVI 7.1 Remote user Interface using Enterprise Connectivity Toolkit

    I have an application programmed in Labwindows/CVI 7.1 controlling an Electromagnetic Instrument.
    Now am interested in extending its usability by adding remote user interface.The goal is to have the application available to be accessed 
    to remote users through website,with multiple users viewing it but one user controlling the instrument remotely at any given point.
    Since the possible methods would be 1.ActiveX 2.TCP/IP 3.DLL
    Which is the best technique to implement this with out having to manipulate much of my code also do we have any documentation available ?
    Thank you
    Solved!
    Go to Solution.

    Hi Mutha,
    This functionality was a part of the orignal Internet Toolkit for CVI.  However, the web server part of this was removed and isn't included in the Enterprise Connectivity Toolkit.  You might consider using LabVIEW with the Remote Front Panel feature.
    Cheers, 

Maybe you are looking for