06-16-2024 05:06 PM
06-17-2024 02:01 AM
Hi leeyeonwoo,
please tell us how you understand the code!
I can say there are bugs (or missing items) in this code and there are some very bad constructs (like wrong datatypes)…
Btw. did you know we cannot edit/debug/run images in LabVIEW? So please don't call those pictures "code", there are just "images of code"!
06-17-2024 06:47 AM
I didn't understand the case condition, and I also didn't understand the NXOR side.
06-17-2024 06:54 AM
Hi lee,
@leeyeonwoo wrote:
I didn't understand the case condition, and I also didn't understand the NXOR side.
Me neither.
A boolean function of two inputs and one of them a constant is mostly Rube-Goldberg: draw the truth table on a sheet of paper and simplify this part of the code...
06-17-2024 07:23 AM
As you probably know, LabVIEW is a programming language developed for doing Engineering (that's what the "E" in LabVIEW stands for). If you are using LabVIEW to "do Engineering", then it is probably interfaced with some mechanical or electrical measuring devices. It is helpful to tell us about the hardware connected to the LabVIEW code.
In your case, I'm guessing that you have a resolver or something that outputs pulses as something rotates, and your LabVIEW program is reading digital pulses. It is important to tell us about the Inputs and Outputs, and about what hardware you are using to do this. It is also important to tell us about your LabVIEW system, including the Version of LabVIEW and whether you are running 32-bit or 64-bit LabVIEW). As mentioned, we also need to see the LabVIEW program itself (not pictures!) -- since those of us who have been using LabVIEW for a decade or more are probably not using the latest version of LabVIEW, you need to "Save for Previous Version" and specify LabVIEW 2019 or 2021.
Assuming my assumptions about your hardware are correct, and you have a resolver, it is going to produce a pulse when the shaft turns a certain amount. Pulses are typically read with a Digital Input line which returns a value of 0 when the voltage is < 2 V and a value of 1 when > 3 V. What you are interested in is when it goes from 0 to 1. That means you need to know the current value (you are looking for 1) and the previous value (you are looking for 0), and you want the output to be "True" with both conditions are met.
There are many (equivalent) logical expressions that will give you this value. Use Pencil and Paper and a little thought to come up with one, yourself. You should be able to do this without needing a NXOR function ...
Bob Schor
P.S. -- I agree that the code show in the pictures is awful!