LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trying to get Hex values(5000 hex values) from serial and save them in text file

Trying to get Hex values(5000 hex values) from serial and save them in text file but when receive 0A in my data it stop reading rest of data? Like if I am sending 100 hex values and 0A comes on start it only read 1 byte and leave rest in buffer on running code next time it fetch from buffer as 0A is for next line but the data I am receiving from FPGA can send any Hex.

Example:

Input to saved in file after from Read serial.

0100020003000400050006000700080009000a000b000c000d000e000f0010001100120013001400150016001700180019001a001b001c001d001e001f0020002100220023002400250026002700280029002a002b002c002d002e002f0030 

but it only read till 19 values as 0A comes, and read rest when code execute second time 

0 Kudos
Message 1 of 13
(4,152 Views)

Hi Ali Afzal,

did you activate the termination char? It should work if you deactivate it.

 

Mike

0 Kudos
Message 2 of 13
(4,144 Views)

Hello Mike

Thanks for reply, kindly if you can explain me how to deactivate it? 

the values from FPGA are send as HEX but on Serial Read it would be as String .... 

Is there way that i can recive the same Hex values and save in text file with each value in new line just like stack 

0 Kudos
Message 3 of 13
(4,139 Views)
 
Download All
0 Kudos
Message 4 of 13
(4,130 Views)
Thanks problem is solved
0 Kudos
Message 5 of 13
(4,122 Views)

Hi Ali Afzal,

the red marked constant should solve your problem. I recommend to open the serial port only ones outside the loop and close it afterwards.

 

Mike

0 Kudos
Message 6 of 13
(4,109 Views)

Hello Mike

Thanks for your help, I have one more query.

Actually I am doing project which require Communication between Oscilloscope(DSO7054A) and signal generators(agilent E8257D and E4438C), as shipment will take time to reach me I have short time period can you guide me for some sort of simulator on LAN if I can run labview oscilloscope simulator on one system and original application on other..... I hope you under stand

 

Regards

 

M. Ali 

0 Kudos
Message 7 of 13
(4,070 Views)

Hi,

 

National Instruments offers the ability to simulate much of our hardware in LabVIEW through our software drivers so you can develop before you receive your hardware. If you are not using National Instruments hardware, I would suggest contacting the hardware manufacturer or searching the web for an appropriate simulator specific to your hardware.

 

 

Asa Kirby
CompactRIO Product Marketing Manager
________________
Sail Fast!
0 Kudos
Message 8 of 13
(4,037 Views)

Hello

Thanks you ppl for help, i have one more problem regarding the serial,

- First command is send on COM 1 to send data on its ACK as "S" data is delivered on COM port

 "3", i want this continues data to be stored on text file. Reading the serial should not be event based, when the bytes stop coming file should save and code exist

 

Thanks in advance

0 Kudos
Message 9 of 13
(3,945 Views)
As a rule of thumb, if you want help with a VI, you should make every attempt to make your code readable. You have violated just about every rule regarding wiring that there is. Wires go every which direction, are hidden under other objects, etc. Some of your code just does not make any sense. Your conversion of the numerics to string at the beginning is way to complex and I don't understand the use of the VISA Assert Trigger. I don't see where you've configured the property node to issue a *TRG for a serial instrument. Also, the way that you've configured the while loop with the read seems like you are likely to be passing empty strings to the file save functions. Again, you've made the logic in this loop hard to read because of your wiring techniques. Spend some time cleaning things up and repost the code.
0 Kudos
Message 10 of 13
(3,924 Views)