01-23-2011 01:24 PM
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
01-23-2011 10:58 PM
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.
01-24-2011 10:26 AM - edited 01-24-2011 10:28 AM
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.
01-24-2011 05:18 PM
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.
01-25-2011 02:29 PM
Wire the desired value into the "secin" input.