Shop OBEX P1 Docs P2 Docs Learn Events
Trouble reading PINK variable — Parallax Forums

Trouble reading PINK variable

MikeSMikeS Posts: 131
edited 2008-04-01 19:15 in General Discussion
Hello,
I am working on a PINK project. I have an SX28 sending outside temperature and inside temperature to the PINK. The outside temperature is obtained from a 433MHz RF receiver and the inside temperature is via a LTC1298 and a LM34 mounted alongside the SX. I successfully accomplished· this and can view the temperatures on a web page loaded in the PINK.· The web page will also let me change the contents of PINK Variable Number 10 to a 1 or 0 via a Radio button (verified via PINK).
Here is what I am having trouble doing. I want to check the contents of Variable #10. If it is a one (1) then I want to make RC.1 go high, thus triggering an SSR. I am monitoring the RC.1 pin with an LED and nothing happens, it appears that the SERIN statement is timing out or my code is not detecting the ASCII one("1").
BTW, I have done this with the BS2.
Working code is attached, it does contain un-used subroutines. Any help/suggestion you may offer will be much appreciated.
MikeS

Comments

  • Sens-a-DatSens-a-Dat Posts: 44
    edited 2008-03-25 14:27
    Mike,

    I believe you have one too many commas in the SERIN command. Here is what I saw in your code:
    '************** Read and Test value of PINK Variable # 10 **************************
        TX_STR "!NB0R10:"                'request read from Var #10
        SERIN, RX, BaudMode, NBVAR, 1000, ToLabel
    
    



    Just remove the comma after the SERIN command.

    Gary
  • MikeSMikeS Posts: 131
    edited 2008-03-25 14:39
    Gary,

    Thanks for looking at the code but that is not the problem, that was just a typo that I made before I posted the code here. It won't even compile with that comma there.



    MikeS
  • BeanBean Posts: 8,129
    edited 2008-03-25 15:00
    Mike,
    Can you post the working BS2 code too ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com

    ·
  • Sens-a-DatSens-a-Dat Posts: 44
    edited 2008-03-25 15:37
    Anyone,

    What command is READINC? I have not seen any mention of it in the SX/B help file, Gunther's book, nor the SK-Key Manual?

    Thanks,
    Gary
  • BeanBean Posts: 8,129
    edited 2008-03-25 16:22
    Gary,
    It is in the latest help file that you can download from here http://forums.parallax.com/showthread.php?p=597707

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com

    ·
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2008-03-25 16:22
    Mike,

    I am not very familiar with the P.I.N.K. (I know what it is but have never used it.) However, in looking at your program I see that after you send data to the P.I.N.K. you spend a fair amount of time blinking LED2. Unlike the SHIFTIN command which only clocks in data when it is ready, SERIN has to be "watching" for the data when it is being sent. Otherwise it will miss some or all of what is transmitted. I suspect that while you are blinking LED2 the data from the P.I.N.K. is being sent. If so, your program will not be expecting it at that time and will not receive it. Try moving your SERIN statement and related logic to right after you send the data (or whenever you can expect the P.I.N.K. to send data back.)

    You might also need to play with the baudmode setting unless you are certain what it should be. It might help if you can connect the P.I.N.K. to the serial port of your computer temporarily and use a terminal program to verify that what you think is being sent is actually being sent.



    Sens-a-Dat,

    READINC is similar to READ but increments the index automatically. This is explained with READ in the latest version of the help file. If it is not explained in your version you may want to download the latest update. You can find the latest version in a "sticky post" at the top of this forum.


    - Sparks
  • Sens-a-DatSens-a-Dat Posts: 44
    edited 2008-03-25 16:56
    Thank you, Bean. I appreciate your help in getting me straight on things.

    I am very impressed with Parallax (both personnel and products) and the support provided by others here in the forums.

    Gary
  • MikeSMikeS Posts: 131
    edited 2008-04-01 01:15
    Hi,

    Still have not figured out this PINK problem.

    Bean, You asked for a copy of the BS2 code that worked with the PINK, it is attached.

    Sparks, I removed all the blinking led stuff still no help. I know the Baud is correct because it works for the writing of the Temps to the Pink variables.

    I did place a·PAUSEUS 10 statement between the SEROUT read request and the SERIN request and ·I did get valid data back one time - just once. It has to be a timming issue with the SX.

    confused.gif Thanks



    Mikes
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-04-01 16:03
    Mike,

    Try removing the colon from the command you're sending...That shouldn't be there for a read operation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • MikeSMikeS Posts: 131
    edited 2008-04-01 19:15
    Chris;

    You da Man! The colon was it. I really appreciate you and the others who took time to look for the problem.

    Now if I could only get the SX to communicate with the Digiencabulator via the PINK! lol.gif

    Thanks again,

    MikeS
Sign In or Register to comment.