LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i want to send a file through serial port

hi sir i have implemented AES on FPGA i can give string data to fpga for labview and recive the encrypted on other hand through serial port

now i want to send a file to be encrypted and recive it on other hand in a file shape plz hepl me out in ths

maak

 

0 Kudos
Message 1 of 5
(3,491 Views)

You would do it the same way.  A file is essentially just a longer string of bytes than a normal string would be.  The only thing you would have to worry about those is controlling the speed of transfer of those bytes relative to the size of the serial buffers.

 

If you tried to send 10,000 bytes all at once to a serial port that had only a 4kb buffer, then you would overwrite the buffer and generate an error.  So any code you write would have to check the number of bytes in the buffer before adding anymore for writing.

Message 2 of 5
(3,472 Views)

sir

how can i send a file on serial port from my VI i mean i want an option on my VI to select a file and then to send it on serial port thn after the encryption how i will get the file in the same formate

maak

0 Kudos
Message 3 of 5
(3,454 Views)

You are going to need to program that yourself.  What is on the other end of the serial cable?  Is it another PC running LabVIEW?  What encryption are you talking about?  Search for examples on Serial Read and Write and also File Read and Write.  They'll give you ideas on how to handle each aspect.  Then come up with a flowchart on how you want the program to run and program it.  You would select the file, open it read some bytes, put them into the Serial buffer.  Wait.  See how much space is in the buffer and put some more bytes in.  Loop until the file ends.  Close the file, close the serial port.

 

On the other end you will read the serial port, open the file, and write the bytes to it.  Do it continuously until the serial port ends.  Close the port, close the file.

 

If you run into any specific issues with the program, post the questions in this thread and people will help.

Message 4 of 5
(3,437 Views)

I posted links to example in your other thread.  But please continue the discussion in this thread as Ravens Fan suggested.

 

R

Message 5 of 5
(3,408 Views)