LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically set date of picktime.vi

I am using the picktime.vi calendar as a subpanel (yes...i am aware there is an activex calendar -- using it is not an option right now). Anyways, what I want to do is if a user wants to edit a record that was on the date  1/1/11 but currently the date selected in the calendar is 2/2/11, I want to programmatically set the date back to 1/1/11. I can use value signaling properties to set the month and year, but because the date is a MC listbox controlled in the VI only through mouse up/keyup events I am not sure how to set this. Does anyone have any ideas?

 

One thought I have is to add a state to the VI called set date, but I'm trying not to modify it since it is native to LabVIEW and is called when the calendar icon is pressed next to a timestamp control. I could make a copy of this VI and do that, but again, I'm trying to avoid this.

 

Suggestions?

 

The picktime.vi is located in <LabVIEW Dir>\resource\dialog

0 Kudos
Message 1 of 5
(2,882 Views)

Hi,

That vi uses system date and time. You can change system date and read back to have new date and time.

I think this is what you want, may be I am  misinterpreting the problem.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 5
(2,855 Views)

Thanks for the response, but no this is not exactly what I want. I don't want to actually change the date of the computer, I just want to set the date the calendar has selected to some other date. The computers date/time is only used on initialization of the VI or when the user pressed the "now" boolean.

 

Think of it this way --

 

I select 1/24/11 on the calendar and add a record for that date, which puts an entry in a MC listbox

I then select 1/22/11 on the calendar and add a record for that date which puts another entry in a MC listbox

So, now the calendar shows 1/22/11 highlighted

Then I say, oops, the record I entered for 1/24/11 has a typo, so I select that record in the MC listbox and press edit to make the change

The calendar should then be set back to highlighting January, 24 2011.

 

0 Kudos
Message 3 of 5
(2,831 Views)

It looks like the picktime.vi is already able to handle the default time to be specified.  There is an input called "secin".  When this input is wired to the subVI, it initializes with the specified date/time.  When your listbox is edited, just pass the chosen timestamp into the picktime.vi.

 

This solution should work fine as long as you are re-calling the VI everytime your "edit" button is pressed.  If you contantly have the picktime subVI open, then you will have to modify the VI like you descibed above using value signaling.  I hope this information helps.

Zach C.
Field Engineer
Greater Los Angeles

0 Kudos
Message 4 of 5
(2,813 Views)

Wire the desired value into the "secin" input.

0 Kudos
Message 5 of 5
(2,791 Views)