Announcement

Collapse
No announcement yet.

Issue with sending a variable to form0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with sending a variable to form0

    Hello,

    I have an odd issue that i can not figure out. I'm using a Gen4-uLC-35DCT-CLB with an arduino nano to control an annealer. Everything worked fine until i added a current and voltage sensing circuit. The coil voltage and coil current both fluctuate quite a bit, much more than they did during standalone testing (not using the LCD, used a separate arduino nano and read values through serial monitor). I then inserted a string item on form 4 to help troubleshoot and i got stable values as i did for the standalone testing. Then i inserted a string item on form0 and did not get stable values. So what i know is that the arduino is sending the correct values to the LCD (being that they are displayed on form4 on string items and leddigits as well, see form4 video with green font), but for some reason the values change when sent to form0 (see form0 video with blue font). I've tried changing the index numbers (leddigits3 to leddigits5) with no success. Any suggestions?



    here is the section of code that does the writing (full code is attached):

    int c = round(valueC * cMod);
    int v = round(valueV * vMod);
    genie.WriteStr(0, v);
    genie.WriteStr(1, c);
    genie.WriteStr(2, v);
    genie.WriteStr(3, c);
    genie.WriteObject(15, 12, v); //LCD Voltage Update leddigits12 id:15
    genie.WriteObject(15, 13, c); //LCD Current Update leddigits13 id:15
    genie.WriteObject(15, 8, v); //voltage to form4
    genie.WriteObject(15, 9, c); //current to form4


    Videos:

    form0: https://www.youtube.com/watch?v=-xF5Y5qM-7U
    The values in question are coil current and coil voltage. the values c and v are displayed to the right of the leddigits using WriteStr.

    form4: https://www.youtube.com/watch?v=ZFgb...ature=youtu.be
    Voltage is on top and current on bottom. values c and v are also displayed to the right of their corresponding leddigits.
    Attached Files

  • #2
    Hi,

    Welcome to the forum!

    Is the issue you are having relates to the sudden jump on the values for the voltage and current? In any case, the values displayed on the LED digits and string are the one being read/transmitted by the Arduino. There should be no difference when you send the values to "Form0" or "Form4".

    On a side note, can you try to increase the baud rate you are using? Also, I notice that you have two instances of genie.DoEvents();. You can omit the one on the if-condition.

    You could also try to print the values on your Arduino's Serial Monitor just to check if you are transmitting the correct values. To communicate with the display, you could use the Software Serial.

    Best Regards,
    Kevin

    Comment


    • #3
      Hello Kevin and thanks!

      The issues lies in the relatively large jumps of the values displayed on form0. The values should jump around a bit, but the spread should be 0.2 V or 0.2 A max. On form4, this holds true for some reason.


      On a side note, can you try to increase the baud rate you are using?
      What value do you recommend for the baud rate?

      Also, I notice that you have two instances of genie.DoEvents();. You can omit the one on the if-condition.
      If i remove this, can the arduino still receive reports from the LCD while in the if-condition?

      You could also try to print the values on your Arduino's Serial Monitor just to check if you are transmitting the correct values. To communicate with the display, you could use the Software Serial.
      I have done that in parallel as the LCD displays values. The values on form0 showed large jumps inconsistent with what was shown on the serial monitor. Then immediately after without restarting anything, I changed to form4 on the LCD and the values showed small jumps that were consistent with what was shown on the serial monitor.

      Comment


      • #4
        Hi,

        Thank you for your reply.

        What value do you recommend for the baud rate?
        You could increase it to 115,200 or 200K. Just to test if you can receive a much reliable data.

        If i remove this, can the arduino still receive reports from the LCD while in the if-condition?
        You already have the doEvents on the loop, however, if you have a blocking condition inside the loop then it may be necessary to keep it.

        I have done that in parallel as the LCD displays values. The values on form0 showed large jumps inconsistent with what was shown on the serial monitor. Then immediately after without restarting anything, I changed to form4 on the LCD and the values showed small jumps that were consistent with what was shown on the serial monitor.
        Does the value on the Serial Monitor different from what you receive on the LCD? Can you try to update it for every second just to see if that is really the case?

        Best Regards,
        Kevin

        Comment

        Working...
        X