LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format Time/Date String

Solved!
Go to solution

Hi everyone,

My project is about logging voltage sensor data into a table. So, each time the push button is pressed, the voltage data should be inserted into the table. However, there's an error in the VI I created: the date and time keep getting added to the table continuously, even when the push button is not pressed.

Is there anyone who can help me to fix the VI that I made?

Here, I’m attaching a screenshot of the VI and the resulting table.

Thankyou 🙂

Download All
0 Kudos
Message 1 of 6
(183 Views)

Hi Anesh,

 


@Anesh4.0 wrote:

However, there's an error in the VI I created: the date and time keep getting added to the table continuously, even when the push button is not pressed.

Is there anyone who can help me to fix the VI that I made?


There is more than one error in your VI!

 

Which kind of help do you expect when all we get are two images? We cannot edit/debug/run images in LabVIEW!

 

On your code image:

  • Why do you initialise the COM port in each iteration?
  • Why is there no error handling?
  • Why don't you enforce execution order by DATAFLOW? (like using error wires…)
  • Why do you use a shift register to hold the table data, but still get data from table control and write into table local?
  • Why is that table a control at all?
  • Why do you use InsertIntoArray when you want to build an array? Use BuildArray!!!
  • Which "push button" are you talking about? There is no "push button" in your images…
  • Why do you expect to add data to the table only on "push button"? I don't see any case structure that would add the data conditionally
  • Why don't you cleanup that code?
  • Why do you use a TermChar for serial communication, but still that BytesAtPort property? This is wrong! (Watch this video!!!)
  • Why do you call your thread "Format Date/Time string"? It isn't related to that function at all…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(169 Views)

I'm working on a project to measure voltage using a 25V voltage sensor. I’ve already set up the circuit with an Arduino Nano, the voltage sensor, an HC-05 for Bluetooth, and a pushbutton. The idea is, every time I press the button, the sensor reads the voltage and sends the data over Bluetooth, and it gets saved into a table.

But when I tried to create the VI in LabVIEW, I ran into an error like I mentioned earlier.

Sorry if I made some mistakes in my previous post—I'm still new to LabVIEW and this community. This is actually my first time doing a project with LabVIEW.

I really hope you can help me out!

0 Kudos
Message 3 of 6
(151 Views)

Hi Anesh,

 


@Anesh4.0 wrote:

I’ve already set up the circuit with an Arduino Nano, the voltage sensor, an HC-05 for Bluetooth, and a pushbutton. The idea is, every time I press the button, the sensor reads the voltage and sends the data over Bluetooth, and it gets saved into a table.


Ok, that pushbutton is a piece of hardware!?

 

In your code you read the COM port in each iteration and you store that data in the table - even when you don't receive anything. YOUR code is doing what YOU have programmed to do!

 

Again: implement error handling and store data only when you receive a valid message…

 

On your VI:

I mainly use LV2019, so please downconvert the VI before attaching. (File->Save for previous)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(135 Views)

Yes, it is a hardware pushbutton.

Here I attach my VI. Thank you for being willing to help me, Gerd. Your help will means a lot to me."

0 Kudos
Message 5 of 6
(122 Views)
Solution
Accepted by topic author Anesh4.0

Hi Anesh,

 

see the attachment for some suggestions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(113 Views)