DFex ftp uploading

Recommended Posts

trying to find out why ftp.upload() is failing DFexp 5.84 LJ U3

set up all stuff for ftp xfr

print doubletostr ftp.bytestoTransfer and ditto ftp.bytesTransfered both always -1

do ftp.upload() with ignore("all") BEFORE since I often get server time out with no error code



print doubletostr ftp.bytestoTransfer and ditto ftp.bytesTransfered both always -1

This is while trying to connect to a server that is down (home.bellsouth.net)

Connecting to a server that is receiving ftp data results in the same -1 values

Are bytes* ONLY valid during the ftp.upload() function call??????

tried the print right after ftp.upload() and got same -1's

what am I doing wrong?

I'm trying to find out if there is an ftp upload failure so that I can switch webpage servers.


Link to comment
Share on other sites

Do you have ignore("all") still? You really should never use this command. It was created long ago when customers were switching from release 3.x of DAQFactory to release 4.x because release 3.x would ignore errors in script (which wasn't really script then). You should always use try/catch so you know what is happening. My guess is that you are getting an error message that tells you what is wrong, but since you have ignore('all'), the script is just ignoring it.

Link to comment
Share on other sites

I'm mainly interested in the ff vars always being -1.

ftp.bytestoTransfer and ftp.bytesTransfered

so i can adjust the ftp timeout variable

sometimes the webpage server (normally home.bellsouth.net) is sluggish receiving ftp data.

if i knew the difference between *toTransfer and *Transfered, could adjust the timeout.


Link to comment
Share on other sites

To transfer is how much is going to be transferred, basically the file size. Transferred is how much has been transferred so far. These don't get set until the connection is established, so if they are -1, -1 and never change, then the connection is probably never getting established.

Link to comment
Share on other sites

  • 2 weeks later...

Haven't been able to bullet-proof ftp.upload() generate errors.

Normally have 2 sequences in infinite loops wirh varous delays(). One is a watchdog with 10 sec delay, the other collects data from a LJ U3 (LJ_raw_io) at 10 sec and 60 sec intervals. At end of 360 secons it does an x=LJ_conv() sequence call, then continues looping.

LJ_conv converts raw data and puts into channels with *.addvalue

this triggers channel event code every 6 minutes.

One of which...

every 6 minutes ftp's 2 files.

every hour spawns a thread (beginseq) that ftp's several files.

and IF at end of day, does several more ftp's of files.

ALL ftp'ing is done thru calls to one sequence (ftp_to_eka)

The question..... WHERE do I put TRY/CATCH code???? since ftp.upload() is running as an async function. and with my normal server, can take over 11 sec (ftp.timeout=11000) to complete xfr.

Only one ftp error has a DF tag (FTP-0000), the rest typically start with "An error occurred...."

The FTP-0000 can occur even tho I have code similar to this BEFORE setting up ftp params

while (FTP.bytesToTransfer !=(-1))


count +=1

if (count >10)





DFexp 5.84, WinXP, grunge machine

Any suggestions ???


Link to comment
Share on other sites

think i've got try/catch working.

sort of curious how it works, only thing i can figure is that try starts an overrview monitor thread, and

catch() extracts error msgs, and endcatch shuts it all down.

now all i have to do is write code to account for all the identified errors.

suggestion, had


strx =strLastError


looks like if no error, strx not set to null string.



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.