Support Forums
COPYD file name

Hi,

I would like to name my COPYD file name as the date (eg. 09022014.csv). I am not interested with the date+time (which is the default name). I'm interested in the date only because I unload the data only once a day. Anyway this can be done?

TQ [Chandran]

Hi, I would like to name my COPYD file name as the date (eg. 09022014.csv). I am not interested with the date+time (which is the default name). I'm interested in the date only because I unload the data only once a day. Anyway this can be done? TQ [Chandran]

Good morning TQ,

Yes you can by using the CV replacement in the CopyD Destination command

The DT8x has a number of system variables and there ate three you need for this.
20SV hold the Current day
21SV hold the current month
22SV holds the current year

Add these to your code and assign them to channel variables. Then uses these channel variables to build up the data in your unload command.

e.g.
Begin

RA1S LogOnA
RefT ' Measure something

RB1D ' Email data every day
20SV(1CV) 'Read Current day
21SV(2CV) 'Read Current Month
22SV(3CV) 'Read Current Year
Do(CopyD Format=CSV Dest=a:\?(1CV)?(2CV)?(#CV).CSV)
End

Cheers
Roger

Good morning TQ, Yes you can by using the CV replacement in the CopyD Destination command The DT8x has a number of system variables and there ate three you need for this. 20SV hold the Current day 21SV hold the current month 22SV holds the current year Add these to your code and assign them to channel variables. Then uses these channel variables to build up the data in your unload command. e.g. Begin RA1S LogOnA RefT ' Measure something RB1D ' Email data every day 20SV(1CV) 'Read Current day 21SV(2CV) 'Read Current Month 22SV(3CV) 'Read Current Year Do(CopyD Format=CSV Dest=a:\?(1CV)?(2CV)?(#CV).CSV) End Cheers Roger

Tks Roger,

Does that applies to email also? In my below command, where do I put the file name option?

DO{copyd dest="mailto:kelantan_recepient@uat.net.my?subject=KelantanArray1to6_Phase1&interface=ETHERNET&priority=NORMAL&body=Data%20for%20today" format=CSV sched=D data=Y alarms=N start=-0T}

Tks Roger, Does that applies to email also? In my below command, where do I put the file name option? DO{copyd dest="mailto:kelantan_recepient@uat.net.my?subject=KelantanArray1to6_Phase1&interface=ETHERNET&priority=NORMAL&body=Data%20for%20today" format=CSV sched=D data=Y alarms=N start=-0T}

Hi Chandran,

File name creation does not apply for email transmission, it is auto generated.

Best regards,
Rudy Gunawan

Hi Chandran, File name creation does not apply for email transmission, it is auto generated. Best regards, Rudy Gunawan
31
3
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft