One TCP Write to send both Length & Data?

I noticed that the "Flatten to string" VI has a (default) option to prepend the array/string size to the binary output string.  This got me thinking that I could use this rather than the typecast vi to convert my arbitrary data to a string, prepend the length and call TCP Write one time.  On the other side of the connection I would then do your standard two TCP Read calls, the first one being 4bytes for the length, the 2nd one being whatever the length that is returned.  However, no matter what I do, the 2nd TCP Read does not return anything.  Is there no way to do two TCP Reads on one TCP Write?  I thought 'buffered mode' might work, but it didn't.  If there is no way to do this, what is the point of the prepend length option on the Flatten to string? Apparently it has no network application if you have to send the length on its own TCP Write.

I'm going to second what smercurio said. There is no problem with using two (or fifty) tcp reads to read data from one send. See attached example where I use two reads; you could modify it so that you read bytes one at a time using tcp read.
More likely your problem is that tcp write is not sending what you think, and that's probably due to Flatten To String's "prepend length" option. Honestly, I recommend you NEVER use this option. If you want to send the length, just measure the string length and prepend it. At least then you'll always know what you're sending.
The reason to avoid the auto-prepender is that does different things depending on the kind of input, and often that isn't what you want. It was introduced to LabView at the same time as the ill-considered "prepend array or string size" option in the LV 8+ Write To Binary File function (which also only fires in certain contexts, and which also defaults to true.) It just isn't an appropriate default in either case; not everyone out there programs in LabView and you shouldn't have to set "optional" arguments to false just to write binary files without corruption.
-Rob
The attached example is in LV 8.6 
Message Edited by Rob Calhoun on 11-17-2008 02:07 PM
Message Edited by Rob Calhoun on 11-17-2008 02:09 PM

Similar Messages

  • TCP Write Problem Sending "FF"

    Hello people! I'm having a weird problem with TCP Write on sending "FF" (hex). I will explain some tests I have already done and I hope you guys can help me somehow.
    My whole system is something like this:
    [PC 1] --- [MUX/DMX nº1] --- [RF Transmission] --- [MUX/DMX nº2] --- [Serial/Ethernet Converter] --- [Switch] --- [PC 2]
    My objective is to send a message from [PC 2] to [PC 1]. In [PC 2] I use TCP Write and in [PC 1] I use Visa Read.
    When I send anything that doesn't contain "FF" from [PC 2], the [PC 1] receives everything correctly. For example, if I send "12345678" from [PC 2], the [PC 1] will receive "12345678".
    However, when I send a single "FF", the [PC 1] stops receiving from [PC 2]. Being more accurate, it's [PC 2] that stops to send data. If I send "1234FF5678" from [PC 2], the [PC 1] only receives "1234". Then the [PC 2] stops sending any kind of data and it will only send again if I restart the software. [PC 1] continues to receive data from [PC 2] after this restart. If I send "FF" again, [PC 2] stops once more to send data.
    I also tried the other way. [PC 1] used Visa Write and [PC 2] used TCP Read. It worked correctly even sending "FF". I started to think that the problem was in TCP Write.
    Then I tried the following scheme: [PC 1] --- [Switch] --- [PC 2]
    [PC 1] used TCP Read and [PC 2] used TCP Write. I used LabVIEW's example of TPC Active and Passive and it worked correctly to send "FF". I got more confused.
    Then I tried: [PC 1] --- [Serial/Ethernet Converter] --- [Switch] --- [PC 2]
    It occurred the same problem as before. [PC 2] sent correctly to [PC 1] every data that didn't contain "FF". When I sent "1234FF5678", [PC 1] only received "1234" and [PC 2] stopped to send data.
    Well... now I'm out of ideas of tests. I think the problem is with TCP Write or with my serial/ethernet converter. Do you guys have any sugestion or solution?
    Thank you very much. Best regards,
    Solved!
    Go to Solution.

    Yahoou! Finally found the problem. The problem was inside serial/ethernet converter. It had an option "Use NVT (RFC2217)". I searched over the internet and found that "FF" for this kind of protocol has a meaning and probably it was affecting my message.
    I disabled it and then I was able to send "FF" (hex) without any trouble!
    Thanks for your attention. Best regards,

  • Failure modes in TCP WRITE?

    I need help diagnosing an issue where TCP communications breaks down between my host (Windows) and a PXI (LabVIEW RT 2010).
    The bottom-line questions are these:
    1...Are there circumstances in which TCP WRITE, given a string of say, 10 characters, will write more than zero and fewer than 10 characters to the connection? If so, what are those circumstances?
    2...Is it risky to use a timeout value of 1 mSec?  Further thought seems to say that I won't get a 1000 uSec timeout if we're using a 1-mSec timebase, but I don't know if that's true in the PXI.
    Background:
    On the PXI, I'm running a 100-Hz PID loop, controlling an engine.  I measure the speed and torque, and control the speed and throttle.  Along the way, I'm measuring 200 channels of misc stuff (analog, CAN, TCP instruments) at 10 Hz and sending gobs of info to the host (200 chans * 8 = 1600 bytes every 0.1 sec)
    The host sends commands, the PXI responds.
    The message protocol is a fixed-header, variable payload type: a message is a fixed 3-byte header, consisting of a U8 OpCode, and a U16 PAYLOAD SIZE field. I flatten some structure to a string, measure its size, and prepend the header and send it as one TCP WRITE.  I receive in two TCP READs: one for the header, then I unflatten the header, read the PAYLOAD SIZE and then another read for that many more bytes.
      The payload can thus be zero bytes: a TCP READ with a byte count of zero is legal and will succeed without error.
    A test starts with establishing a connection, some configuration stuff, and then sampling starts. The 10-Hz data stream is shown on the host screen at 2-Hz as numeric indicators, or maybe selected channels in a chart.
    At some point the user starts RECORDING, and the 10-Hz data goes into a queue for later writing to a file. This is while the engine is being driven thru a prescribed cycle of speed/torque target points.
    The recording lasts for 20 or in some cases 40 minutes (24000 samples) and then recording stops, but sampling doesn't.  Data is still coming in and charted. The user can then do some special operations, related to calibration checks and leak checks, and those results are remembered.  Finally, they hit the DONE button, and the whole mess gets written to a file.
    All of this has worked fine for several years, but as the system is growing (more devices, more channels, more code), a problem has cropped up: the two ends are occasionally getting out of synch. 
    The test itself, and all the configuration stuff before, is working perfectly. The measurement immediately after the test is good.  At some point after that, it goes south.  The log shows the PXI sending results for operations that were not requested. The data in those results is garbage; 1.92648920e-299 and such numbers, resulting from interpreting random stuff as a DBL.
    After I write the file, the connection is broken, the next test re-establishes it, and all is well again.
    In chasing all this, I've triple-checked that all my SENDs are MEASURING the size of the payload before sending it.  Two possibilities have come up:
    1... There is a message with a payload over 64k.  If my sender were presented with a string of length 65537, it would convert that to a U16 of value 1, and the receiver would expect 1 byte. The receiver would then expect another header, but this data comes instead, and we're off the rails.
      I don't believe that's happening. Most of the messages are fewer than 20 bytes payload, the data block is 1600 or so, I see no evidence for such a thing to happen.
    2... The PXI is failing, under certain circumstances, to send the whole message given to TCP WRITE.  If it sent out a header promising 20 more bytes, but only delivered 10, then the receiver would see the header and expect 20 more. 10 would come immediately, but whatever the NEXT message was, it's header would be construed as part of the payload of the first message, and we're off the rails.
    Unfortunately, I am not checking the error return from TCP write, since it never failed in my testing here (I know, twenty lashes for me).
    It also occurs to me that I am giving it a 1-mSec timeout value, since I'm in a 100-Hz loop. Perhaps I should have separated the TCP stuff into a separate thread.  In any case, maybe I don't get a full 1000 uSec, due to clock resolution issues.
    That means that TCP WRITE cannot get the data written before the TIMEOUT expires, but it has written part of it.
    I suspect, but the logs don't prove, that the point of failure is when they hit the DONE button.  The general CPU usage on the PXI is 2-5% but at that point there are 12-15 DAQ domain managers to be shutting down, so the instantaneous CPU load is high.  If that happens to coincide with a message going out, well, maybe the problem crops up.  It doesn't happen every time.
    So I repeat the two questions:
    1...Are there circumstances in which TCP WRITE, given a string of say, 10 characters, will write more than zero and fewer than 10 characters to the connection? If so, what are those circumstances?
    2...Is it risky to use a timeout value of 1 mSec?  Further thought seems to say that I won't get a 1000 uSec timeout if we're using a 1-mSec timebase, but I don't know if that's true in the PXI.
    Thanks,
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks
    Solved!
    Go to Solution.

    There are a couple of issues at play here, and both are working together to cause your issue(s).
    1) LV RT will suspend the TCP thread when your CPU utilization goes up to 100%. When this happens, your connection to the outside world simply goes away and your communications can get pretty screwed up. (More here)
    Unless you create some form of very robust resend and timeout strategy your only other solution would be to find a way to keep your CPU from maxing out. This may be through the use of some scheduler to limit how many processes are running at a particular time or other code optimization. Any way you look at it, 100% CPU = Loss of TCP comms.
    2) The standard method of TCP communication shown in all examples I have seen to date uses a similar method to transfer data where a header is sent with the data payload size to follow.
    <packet 1 payload size (2 bytes)><packet 1 payload..........><packet 2 payload size (2 bytes)><packet 2 payload.......................>
    On the Rx side, the header is read, the payload size extracted then a TCP read is set with the desired size. Under normal circumstances this works very well and is a particularly efficent method of transferring data. When you suspend the TCP thread during a Rx operation, this header can get corrupted and pass the TCP Read a bad payload size due to a timeout on the previous read. As an example the header read expects 20 bytes but due to the TCP thread suspension only gets 10 before the timeout. The TCP Read returns only those 10 bytes, leaving the other 10 bytes in the Rx buffer for the next read operation. The subsequent TCP Read now gets the first 2 bytes from the remaining data payload (10 bytes) still in the buffer. This gives you a further bad payload read size and the process continues OR if you happen to get a huge number back, when you try to allocate a gigantic TCP receive buffer, you get an out of memory error.
     The issue now is that your communications are out of sync. The Rx end is not interpeting the correct bytes as the header thus this timeout or bad data payload behavior can continue for quite a long time. I have found that occasionally (although very rare) the system will fall back into sync however it really is a crap shoot at this point.
    I more robust way of dealing with the communication issue is to change your TCP read to terminate on a CRLF as opposed to the number of bytes or timeout (The TCP Read has an enum selctor for switching the mode. In this instance, whenever a CRLF is seen, the TCP Read will immediately terminate and return data. If the payload is corrupted, then it will fail to be parsed correctly or would encounter a checksum failure and be discarded or a resend request issued. In either case, the communications link will automatically fall back into sync between the Tx and Rx side. The one other thing that you must do is to encode your data to ensure that no CRLF characters exist in the payload. Base64 encode/decode works well. You do give up some bandwith due to the B64 strings being longer, however the fact that the comm link is now self syncing is normally a worthwhile sacrifice.
    When running on any other platform other than RT, the <header><payload> method of transmitting data works fine as TCP guarantees transmission of the data, however on RT platforms due to the suspension of the TCP thread on high CPU excursions this method fails miserably.

  • Download file format(different length data on one column)

    Hi all,
    i am just writing a report to download the delivery data to a file.the file have 3 columns.the length of the column data in every row varies.
    let my file structure is like
    first line of my file contains,
    delivery no(22),delivery date(8),delivery type(5)
    2nd line of the file contains,
    shipper num(48),customer PO num(20),material num(15)
    In the first column of this file contains delivery number(length-22)& shipper number(length-48).but the length of both the data will be different i.e i have to assign the length of delivery num as 22 & length of shipper num as 48.but they will appear in one column. how it will be possible.
    is there any command to make the file format like this?
    ur help is highly appreaciated.it's urgent.
    Regards
    pabitra

    whatever record you will populate(i mean it may be either delivery no or shipment no etc..)define your internal table with the highest length(in this case 48).
    as both values are CHARacters, there is no problem even if you populate Delivery no(of 10 chars) to 48 char field.
    spaces will be truncated.
    data:begin of itab,
    col1<b>(48) type c</b>,
    col2,
    col3,
    end of itab.
    *--when you are populating Delivery no:
    ITAB-COL1+0(10) = V_DELIVERYNO.
    CONDENSE ITAB-COL1+0(10) NO-GAPS.
    *--when you are populating SHIPMENT no:
    ITAB-COL1+0(48) = V_shipment.
    CONDENSE ITAB-COL1+0(48) NO-GAPS.
    i guess,there wont be any problems,if you use this logic.
    Regards
    srikanth

  • Is it possible to create a virtual TCP port and send data to it?

    Is it possible to create a virtual TCP port and send data to it?
    My application is this:   I am reading a constant stream of waveform data from a device via a LabVIEW VI set and I need to get that streaming data to a .NET application.  I can poll a TCP port in .NET easily so is there a way I can create a virtual TCP port in LabVIEW and send the data there?

    Have a look at the example called simple data server and simple data client and see what you can get from that. I'm not really familiar with TCP myself.
    Joe.
    "NOTHING IS EVER EASY"

  • TCP Write loosing packages

    Dear,
    When I use TCP Write in fast succession (immediate one after the other) TCP packages are lost.
    When I program 3 time TCP Write just one after the other the 3rd packages is lost.
    Doing it in the same way with a timed loop of 1ms it works propperly.
    So what is going on in LabVIEW?
    Any Ideas?
    Kind regards
    Martin
    Attachments:
    TCP.png ‏47 KB

    Are you running wireshark on the sender or in the receiver end?
    TCP is designed to run un unreliable networks, and packet loss always occurs at some level, at which case the missing packet is retransmitted.
    A TCP connection is initiated with a threeway handshake and both sides keep track of every single packet. Packets can arrive out of order, some missing, even some in duplicate, and the receiver will make sense of it, reassemble, and request retransmissions.
    Your third message is part of the same TCP connection so it is difficult to image it go missing unless one of the sides resets the connection prematurely.
    Kunze wrote:
    The receiver is allwas ready since it is a peer to peer with 100Mbit/s
    What does network speed have to do with readiness? What program is receiving the packets and who wrote it?
    Did you update the network drivers?
    Can you attach filtered wireshark traces, one recorded on each side, showing all communication between these two nodes?
    LabVIEW Champion . Do more with less code and in less time .

  • Double TNS datagrams in one TCP packet

    I have the following Problem:
    During a database Connection over an IPSec - tunnel between a Fortigate and a Juniper firewall the connection stalls.
    This is exactly reproducible with on select or bulk insert statement. Neither OCI or thin changes the behavior. Without the tunnel(f.e. LAN or ISDN connect)
    there no problem an no duplicate TNS.
    I have logged the TCP traffic with wireshark on both sides and noticed that I have two tns datagrams in one TCP packet.
    I use different IPSec tunnels and haven only problems with this one. Do you have a hint whats going on?
    BTW: I change sdu and tdu sizes. This changes the point in time of the stall (double tns).
    Here is the Wireshark Log:
    519     1128.135566     192.168.197.33     10.4.100.73     TNS     Request, Data (6), Data
    520     1128.135912     192.168.197.33     10.4.100.73     TNS     Request, Data (6), Data
    521     1128.179202     10.4.100.73     192.168.197.33     TCP     [TCP Window Update] ncube-lm > 64542 [ACK] Seq=7203 Ack=2341 Win=65535 Len=0
    522     1128.202975     10.4.100.73     192.168.197.33     TCP     ncube-lm > 64542 [ACK] Seq=7203 Ack=3691 Win=64185 Len=0
    523     1128.213284     10.4.100.73     192.168.197.33     TNS     Response, Marker (12), Attention
    524     1128.213516     10.4.100.73     192.168.197.33     TNS     Response, Marker (12), Attention
    525     1128.213557     192.168.197.33     10.4.100.73     TCP     64542 > ncube-lm [ACK] Seq=4265 Ack=7225 Win=64201 Len=0
    526     1128.217649     192.168.197.33     10.4.100.73     TNS     Request, Marker (12), Attention
    527     1128.255460     10.4.100.73     192.168.197.33     TCP     [TCP Dup ACK 524#1] ncube-lm > 64542 [ACK] Seq=7225 Ack=3691 Win=65535 Len=0
    * 528     1128.501575     192.168.197.33     10.4.100.73     TNS     [TCP Retransmission] Request, Marker (12), Attention
    529     1128.588704     10.4.100.73     192.168.197.33     TCP     ncube-lm > 64542 [ACK] Seq=7225 Ack=4276 Win=64950 Len=0
    Here the connection stalls, but does not terminate. The data transmission is not finished.
    The * packet has the following header information:
    Frame 528: 639 bytes on wire (5112 bits), 639 bytes captured (5112 bits)
    Ethernet II, Src: FujitsuT_92:f0:b5 (00:19:99:92:f0:b5), Dst: Fortinet_25:ea:de (00:09:0f:25:ea:de)
    Internet Protocol, Src: 192.168.197.33 (192.168.197.33), Dst: 10.4.100.73 (10.4.100.73)
    Transmission Control Protocol, Src Port: 64542 (64542), Dst Port: ncube-lm (1521), Seq: 3691, Ack: 7225, Len: 585
    Transparent Network Substrate Protocol
    Packet Length: 574
    Packet Checksum: 0x0000
    Packet Type: Data (6)
    Reserved Byte: 00
    Header Checksum: 0x0000
    Data
    Transparent Network Substrate Protocol
    Packet Length: 11
    Packet Checksum: 0x0000
    Packet Type: Marker (12)
    Reserved Byte: 00
    Header Checksum: 0x0000
    Attention
    Marker Type: Data Marker - 1 Data Bytes (0x01)
    Marker Data Byte: 0x00
    Marker Data Byte: 0x02
    Any idea?

    Ben wrote:
    Convert dbl to U64 then use swap words. Swap Words is polymorphic and will adapt the the data type you prest to it.
    Ben
    Convert is a bad idea here.you want to typecast instead.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to get both OTF data and spool at a time

    Hi Experts,
        My requirement is to get both OTF data and spool.
    In 'OPEN_FORM' i tried passing itcpo-TDGETOTF = 'X'. itcpo- TDNEWID = 'X'.
    I was able to get OTF data but spool is not getting generated.
    IF i pass only itcpo- TDNEWID = 'X'. the spool is getting generated but not OTF data.
    when both the fields are set i.e. itcpo-TDGETOTF = 'X'. itcpo- TDNEWID = 'X'.
    the spool is generation is getting supressed.
    Similarly when i tried to get OTF data by passing itcpo-TDGETOTF = 'X'. to 'OPEN_FORM' as i need to convert it to PDF and send it to vendors as email ,
    The print preview in TCODE ME23n was not getting generated for 'MESSAGE' option 'External send'.
    Please suggest me how to get both OTF data and spool at a time.

    Hi Kartik,
    This one is similar to my question to print and email invoice at same time.  I pass itcpo-tdgetotf = 'X' in order to get otfdata and send email with the attachment of otfdata.
    Now I have data in otfdata, but when I call print_otf function, I clear out itcpo-tdgetotf, and passed
    itcpo-tddest = device_type but I still get error message said 'Handler not valid for open spool request'.
    Can you give me a working example that you have otfdata table and print data from that table.  I also post my question on other thread
    submit report and export to memory
    thanks

  • Probability Of Sending ME/SIM data through WAP enabled on SIM Using Applet

    Dear Friends,
    I am new to java card development.
    Is it possible or what is Probability Of Sending ME/SIM data through WAP enabled on SIM Using Applet?
    Is it feasible to do so? Suppose if we write one application using java card to do so and then will load the applet into Smart card(Java Card).
    Any sugestion will be highly appreciated and will of great help.
    Thanks in advance for the response.
    Regards,
    Sunil K

    Dear Friends,
    I am new to java card development.
    Is it possible or what is Probability Of Sending ME/SIM data through WAP enabled on SIM Using Applet?
    Is it feasible to do so? Suppose if we write one application using java card to do so and then will load the applet into Smart card(Java Card).
    Any sugestion will be highly appreciated and will of great help.
    Thanks in advance for the response.
    Regards,
    Sunil K

  • Method :line.write(audioBytes, 0, audioBytes.length-position) blocks

    I did this method to rewind a real recording.
    public void rewind() throws IOException, LineUnavailableException {
            int numRetro = 0;
            int numBytesRead=0;
            int nBytesWritten = 0;
            pauseRecording();
            SourceDataLine line = null;
            DataLine.Info info  = new DataLine.Info(SourceDataLine.class, frtData);
            byte audioBytes[] = dataCapturada.toByteArray();  
            ByteArrayInputStream bais = new ByteArrayInputStream(audioBytes);
            AudioInputStream audioMemo = new AudioInputStream(bais, frtoData,
                               audioBytes.length/frtoData.getFrameSize());     
            byte  abData = new byte[audioBytes.length];
            try {
                line = (SourceDataLine) AudioSystem.getLine(info);
                line.open(frtoData);
            } catch (LineUnavailableException ex) {
            line.start();
            numRetro = (int) (frtoData.getFrameRate() * frtoData.getFrameSize());
            if(position ==0){  //position is a global variable
                position = numRetro;
            }else{
                position = position+numRetro;
            numBytesRead= audioMemo.read(abData, 0,abData.length-position);
            if(abData.length>position){
                nBytesWritten = line.write(audioBytes, 0, audioBytes.length-position);
                dataCaptured.reset();          //dataCaptured is a global variable of ByteArrayOutputStream
                dataCaptured.write(abData, 0, numBytesRead);
            }With this i am able to cut the "dataCaptured" a "numRetro positions" and then overwrite it wit the new data.
    The problem is that this method: line.write(audioBytes, 0, audioBytes.length-position)blocks until it finishes. I used this method to enable the user to listen what he has record until a certain position. The rewind button its pressed until the method line.write... finishes.
    How can i make this to not block so the user can press the rewind button and not to wait so much to press it again to continue rewind it and listen at the same time.

    captfoss wrote:
    In most cases, you'd be correct. In this instance, I'm about 99% sure that available actually works the way it's supposed to...available() is supposed to tell you how many bytes can be read without blocking. I can't see how available() can solve the OP's problem when it is allowed to return zero all the time. If one creates a solution that uses available() that works for one particular JDK version there is no guarantee that it will work for any other JDK version. There are almost no situations when available() is useful. I remember that ejp did once publish a valid use of available() but I can't remember what it was.
    >
    But yes, threads are (always) a better solution...

  • How to send PR & PO data for materials through IDOC in XML

    Hi Experts,
    I am looking for a solution to send open PR & open PO related data for diffrent materials through as IDCO in XML file.
    Scenario is i have to show a report in a 3rd party system for open PR & open PR that too will come after selection some materials. That means select a materials & it will show all the open PO & related data in a report.
    The rough idea for the solution i got is I can save the data in XML file in the system. For this i have to send IDOC. but the problem is there is no message type for PR. IF i am not wrong i can extend the MATMAS05 for a segment that will have PR related info.
    Now what to do with that how to send the IDOC do i need to create another report to send IDOC or i can send the extended one through BD10. I tried it but it shows error message "0 communication idoc sent" so I dont no y such error is coming i think i am not filling the extended idoc. But again my QUestion is how to do that. If anyone have any other solution Please help me out of this.
    Regards,
    Nik

    Hi Alpesh,
    Thanks for your reply.
    My requirement is bit different. i have to send Open PR data for diffrent materials. In a 3rd party application user will search for few materials which will generate a report that will show the PR related data for those material.
    Same thing i have to do for PO & Sales order also.
    Can u please help me to provide the solution how can i proceed for it. U have given the Message type & a bapi how it will help in my issue?
    I got a suggesion from someone that extend message type matmas for PR, PO, SD related data & send the idoc. but i am confused how to pass that much data ina single IDOC.
    Regards,
    Nik

  • Can I sync podcasts and ITunesU. from one computer to another that both have the same acount.

    Can I sync podcasts and ITunesU. from one computer to another that both have the same account.

    No.  Time Machine won't get your boot camp partition back.  There are excellent utilities that move entire hard drive contents among hard drives such as SuperDuper! and CCC, but as far as I know they don't work with boot camp partition.  My suggestion: reinstall Mac OSX on your new Mac (you don't want to hold Option key to start it everytime anyway), partition it with boot camp exactly (or similarly) as you did to your previous Mac (install the same operating system, which should be one of the Microsoft Windows I assume).  Use Migration Assistant as kaz-k suggested to move all the stuff on the Mac partition of your previous Mac.  Reboot both your Macs from the boot camp partition - I assume they are all on Windows platform.  Now you have two computers on Windows platform.  Use Norton Ghost or similar tools to migrate all the stuff from your old machine to your new machine.  Hope this helps.  Backup all your data before such operation.  Good luck.

  • When we create  one service as preferred on both nodes in  two node RAC

    How to configure listener,tnsnames.ora & listener file When we create one service as preferred on both nodes in two node RAC ... ( I don't need load balancing here but i just want to create service as preferred on both nodes)
    please some one help me in this ..

    Thanks alot Sebastain for your reply..
    I am using 10.2.0.4 version and below tns entry is from my client side tns entry ..
    M4AMPRD_TEST=
    (DESCRIPTION=
    (ADDRESS= (PROTOCOL=TCP) (HOST=153.88.184.228) (PORT=1521))
    (ADDRESS= (PROTOCOL=TCP) (HOST=153.88.184.229) (PORT=1521))
    (FAILOVER=ON)
    (CONNECT_DATA=(SERVICE_NAME=M4AMPRD_TEST)
    (FAILOVER_MODE=
    (TYPE=SELECT)
    (METHOD=BASIC)
    (RETRIES=20)
    (DELAY=5)
    service creation: srvctl add service -d M4AMPRD -s M4AMPRD_TEST -r M4AMPRD1,M4AMPRD2
    But when i connect to database usign above service from client some times its working fine and some times its failing please see below log with timings how it is behaving ..
    SQL> set time on
    18:39:46 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
    Connected.
    18:39:48 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    Warning: You are no longer connected to ORACLE.
    18:39:52 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
    Connected.
    18:39:53 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
    Connected.
    18:39:55 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
    Connected.
    18:39:57 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    Warning: You are no longer connected to ORACLE.
    18:39:59 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
    Connected.
    Thanks for your help in advance
    Anil Vejendla..

  • How to deal with variable length data struct in C/JNI

    I have another JNI related question. How do you handle variable length
    data structures in Java and pointer to a pointer?
    Basically, I have a backend in C which has records but we don't know
    how many. The API looks like
    typedef struct rec_list_s {
    int rec_list_cnt;
    rec_list_data_t rec_list_data[1];
    } rec_list_t;
    int rec_list_show(void handle, rec_list_t *list_ptr);
    /* Code snippet for rec_list_show */
    int rec_list_show(void handle, rec_list_t *list_ptr)
    rec_list_t *ptr;
    sz = sizeof (rec_list_t) +
    ((record_count - 1) * sizeof (rec_list_data_t));
    ptr = malloc(sz);
    /* fill the data */
    *list_ptr = ptr;
    return (0);
    So I need to wrap rec_list_show() in JNI call so I can have Java call
    it. How do i pass a pointer to a pointer from Java? I tried in the
    native C code for JNI to return the pointer to pointer as a result
    and store in a member in the Java class rec_list_t and then I pass
    that to JNI call for rec_list_show. The C backend code was fine
    since it got the pointer to pointer but Java become unhappy when
    the object it was referencing changed memory location (I suspect
    the garbage collection becomes unhappy).
    So what would be a good way to deal with this kind of code?
    Thanks,
    Sunay
    Edited by: st9 on Aug 30, 2010 5:47 PM

    I did not imply that you don't know C but you are implying that I don't understand C. Perhaps
    google Sunay Tripathi and click I am feeling lucky so that we don't get into teaching C
    discussions :) On the other hand, I am definitely looking for someone to teach me Java
    otherwise I wouldn't be asking.
    Anyway, let me explain again. The sample function rec_list_show() runs on the backend. It
    is a different process with a different VM space. It of course knows the size of the array
    and what to fill in. As a caller to that API (which is a separate process), I don't know
    what that size is but I need to get the size and corresponding data in one shot because
    the backend locks the table when its providing me the info to make sure its synchronous.
    Now I (the Java process) needs to get that count and data in one shot. Since the C library
    underneath me (wrapped around my JNI interface) has private IPC mechanism to copy
    the contiguous memory from the backend into my memory space, all I need is to provide
    a pointer to a pointer which gets filled in by backend and is available to my process. So
    my equivalent C frontend just passes a pointer to a pointer and casts the return value in
    rec_list_t. The rec_list_cnt tells it how many members it got. The first member is part of
    the struct itself but then following members are right after.
    Another way to help you understand this is with this code snippet from front end C program
    rec_list_t     *ptr, *save_ptr;
    rec_list_data_t *data_ptr;
    int          cnt;
    save_ptr = ptr = malloc(sizeof(rec_list_t));
    rec_list_show(handle, &ptr);
    assert(save_ptr != ptr);
    cnt = ptr->rec_list_cnt;
    for (i = 0; i < cnt; i++) {
         data_ptr = &ptr->rec_list_data;
    Notice the assert(). Also notice the for loop. How do I expect to walk more that one
    member when rec_list_data is a fixed size array of one member?typedef struct rec_list_s {
         int               rec_list_cnt;
         rec_list_data_t          rec_list_data[1];
    } rec_list_t;
    Anyway, I do understand that Java will not allow me to get a reference to a long and
    how Java memory management works. But the JNI native implementation is C
    and I was wondering if people have managed to do some tricks there between C
    and Java.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Send GP context data in Email using NotificationCo

    Hi Experts,
    In my GP process, when the approver approves a request by user, i want to pass the following details via mail:
    1) Approver name - from context parameter
    2) details of the data approved: - data is in a GP context (data is in a list .. with cardinality 1..n) , and in the context i have stored the needed data like a transaport request list created in R/3 for the data update.
    I want to send both the details through Email , can you guys help me with the Html code needed to fetch the data from Gp context node?
    Regards,
    Ashish

    Got it solved...

Maybe you are looking for