Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#26 2016-05-20 15:29:22

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: REXLANG dynamically assign variable by looping thru txt file

coldh2odvr: In your case the pi user is not allowed to read the file /rex/rexcore/values.txt, see the line

-rw-r----- 1 root root    0 May  5 17:10 values.txt

in your output. In that case you have to use "sudo cat ...".

In my case the pi user can at least read the file, see my output:

-rw-r--r-- 1 root root 1682 May  5 14:15 values.txt

But RexCore runs with root privileges so it can access the file without any problem on both machines. Therefore the only problem was that your file was empty. The question is why? How did you download the example and transfer the files to the RPi?

Btw what pressure gauge are you using? What analog signal does it provide?

Offline

#27 2016-05-20 15:53:08

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: REXLANG dynamically assign variable by looping thru txt file

scoobsalamander wrote:

I'm sorry, I should have told that I'm running everything on Windows now ... sad

That's perfectly fine - it should be working on Windows as well wink

On Windows machine the current look up directory is set to ProgramDara directory e.g.

C:\ProgramData\REX Controls\REX_2_10_8_5910\RexCore\

so the "values.txt" file should be stored here. Then the example should be working as well.

Cheers, Tomas

Offline

#28 2016-05-20 19:30:26

coldh2odvr
Member
Registered: 2016-04-18
Posts: 17

Re: REXLANG dynamically assign variable by looping thru txt file

jaroslav_sobota wrote:

But RexCore runs with root privileges so it can access the file without any problem on both machines. Therefore the only problem was that your file was empty. The question is why? How did you download the example and transfer the files to the RPi?

I used the compile and download function in RexDraw. Since the files appeared on the Pi, I assumed it was transferring them while sending the program.

jaroslav_sobota wrote:

Btw what pressure gauge are you using? What analog signal does it provide?

I'm reading from an Inficon PSG 500, it outputs a 0-10V signal where P(mTorr) = 10^((V-2.448)/1.286). The PLC reads voltage but can't do the exponentials needed to do the conversion to mTorr, hence the lookup table. I'm not currently controlling anything with the gauge but I need a pressure display.

Offline

#29 2016-05-20 19:32:03

coldh2odvr
Member
Registered: 2016-04-18
Posts: 17

Re: REXLANG dynamically assign variable by looping thru txt file

Hi Tomas,

Thanks for the WinSCP tip very helpful.

Offline

#30 2016-05-24 10:27:10

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: REXLANG dynamically assign variable by looping thru txt file

Hey coldh2odvr,

I'm glad that I could help you. I have one more tip for you.

We have recently launched Indiegogo campaign with an add-on board for Raspberry Pi called Monarco. It can help you to interface your pressure gauge directly to Raspberry Pi thanks to analog inputs. Check the Monarco HAT campaign site for more detail about the product.

I also prepared a sample project for you on how to compute the pressure in REX according to the formula from your previous post:

coldh2odvr wrote:

P(mTorr) = 10^((V-2.448)/1.286)

pressure.png

pressure_measurement.zip

Please feel free to contact me if you need any further information.

Regards, Tomas

Offline

Board footer

Powered by FluxBB