06-04-2020 12:22 PM
Hello everyone!
I have made a DES (Data Encryption Standard) VI for work.
The problem with it currently is that the input and output are out-of-sync by a loop.
When the VI is started, after the first iteration, the DES output to the last iteration of the previous run is output. After the second iteration, the output to the first iteration is displayed and written to a text file.
When you run the subVI, names "des_combined", the output matches as it should. Only when run inside of main is it an issue and I can't find any data flow issues that'd cause it.
Any help with this would be greatly appreciated, and any feedback on my programming style would also be appreciated.
Here are 2 easy inputs to the DES algorithm for testing and reference, given a key of ABCDEF0123456789:
Input: FFFF FFFF FFFF FFFF
Output: 6A79 C5FB 6164 2008
Input: 0000 0000 0000 0000
Output: 7229 F9D3 0656 652A
I am using LabVIEW 2018.
WARNING:
This VI writes a txt file to the subfolder "Data". The txt file will be named "Radio_In_x.txt", where x is 1, 2, 3, 4, ...
Solved! Go to Solution.
06-04-2020 12:47 PM
Can you tell us the typical values for all controls and how you are using your toplevel VI. Who write the DES code?
I have no idea how the boolean array is formed in the following code:
What is the "frequency"? What is changing the "test input" control while the loop is running? Seems all so unpredictable.
06-04-2020 12:55 PM - edited 06-04-2020 01:41 PM
OK, you are tapping into the delayed output of the feedback node for the message output. Change your code inside the toplevel DES routine as folllows:
06-04-2020 12:58 PM
The frequency is the input frequency coming into the VI. In the current setup, the user inputs the message coming in via the "Test Input" control. This is only for testing purposes, the final version will be driven by a radio attached to a DAQ.
The boolean array is being created by sampling the input "Test Input" at a rate determined by "Frequency". It's a 64-bit message that comes into the DES algorithm, this loop allows me to create the 64-bit message exactly how the radio will.
06-04-2020 01:04 PM
Dang. Thank you so much. I've spent the last day or so staring at this. Works like a charm now!