10-19-2009 11:04 AM
Hi,
I need to send phyton files to my modem.
My VI works fine with files sizes under 6000bytes, but anything above does not work.
I open the file, read as binary, and simply send this using VISA SEND. Followed by Ready Bytes at port, and VISA Read.
I get this idea that I should break down the data into chunks and send it down the port when file size is larger than 6k bytes ?
Anyone have any experience in this?
Thanks
Goose
LV 8.6
10-19-2009 11:13 AM
What do you mean "doesn't work", can you be more specific?
10-19-2009 11:17 AM
When Sending files up to 6k, I get OK reply from the modem.
But when sending above 6k, I get error.
I've tried changing the buffer size, but this had no effect.
10-19-2009 12:18 PM
10-19-2009 08:32 PM
10-20-2009 05:28 AM
It looks like the problem i have is that the data is sent to the port as a string ?
The type of file I am sending is a object file, and perhaps converting this into a string changes some of the characters?
Should I use something like an u32 array?
Example of file contents below :
™N
ìÔ¸Jc s{ k Z k Z k Z k l k Z k Z k Z k Z k Z d f d „ ƒ YZ
d e
f d „ ƒ YZ d f d „ ƒ YZ d e f d „ ƒ YZ
d e f d „ ƒ YZ d
e f d „ ƒ YZ d e f d
„ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d Z d e f d „ ƒ YZ d e f d „ ƒ YZ h e ƒ d <e ƒ d <e ƒ d! <e ƒ d" <e ƒ d# <e ƒ d$ <e
ƒ d% <e ƒ d& <e ƒ d' <e ƒ d( <e d) e ƒ d* <e d+ e ƒ d, <e ƒ d- <e ƒ d. <Z e
10-20-2009 06:55 AM - edited 10-20-2009 07:02 AM
You shouldn't convert an object file to string, and you should not use a U32 array. (Did you mean flatten to string?)
Have you done a search to see how others have implemented this?
10-20-2009 07:04 AM
Have a look at the following link, which has an example written in LV7.1:
http://forums.ni.com/ni/board/message?board.id=170&message.id=147606
Unfortunately, I do not have LV installed on this PC and could not verify thecontent of the VI. Also, I could not prepare a short example.. 😞
10-20-2009 10:39 AM - edited 10-20-2009 10:40 AM
I posted a follow-up to your question in the other thread. I recommend that you use this thread to resolve your problem. It is much harder if you are using multiple threads to resolve your problem.
A basic copy of my response in the other thread:
What error are you getting? This simple piece of information is crucial in being able to give advice to resolve your problem. I suspect that you are simply timing out on your data transfer. Either you are not giving the receiver enough time to receive the data or you are not allowing enough time for the response. However, without more specifics it will be impossible to give you better advice.
10-20-2009 12:15 PM
Hi, sorry about the mixed threads...got a bit carried away.
Ok, so you've seen my send loop. And as I said, this works 100%, but on bigger files, it does not.
Sending a small file (up to 6k bytes), the modem immediately replies with OK if successfull (I've got a looped delay code which waits until bytes is received at the port before reading it)
Sending a larger file, once sending is completed, I read the port, and the ERROR is received.
I've matched the bytes send output from VISA Send with the file size, and that is identical, so all bytes seems to be transmitted.
Why I get an Error reply I have no idea, I can only suspect port buffers or perhaps something like escape characters being sent down incorrectly - but then again, this is not a problem with small files.
desperate