Skip to Main Content

Embedded Technologies

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Transactional versus CombinedMessage

2833902Sep 6 2018 — edited Oct 30 2018

Hi,

I am trying to understand the semantic differences (if any) between using a Transactional Device and a *CombinedMessage (on the I2C or SPI bus).

The reason I ask is because I am trying to interact with a sensor (the MPU6050 accelerometer/gyroscope/thermometer sensor) which stores measurements in two 1-byte registers (one of which is the MSB and the other the LSB). Those registers are updated at whatever sampling rate has been configured in the sensor and each value can be built by concatenating the two bytes yielding a twos-complement number (effectively a short in the Java world).

Now, the catch is this: As mentioned, the sensor will keep updating those registers at the sampling rate and it becomes the app's responsibility to ensure that that both reads from both registers come from the same sampling instant so that we don't get into a situation where register A's value is from sampling instant #1 and register B's from instant #2. The datasheet suggests two ways of achieving that..you can either keep checking an "interrupt" pin and read the values when that's turned on or you must read both registers whilst the serial bus is busy (i.e. if this is the I2C bus, both reads happen between the "start" and "stop" sequences). So effectively, the bus acts as a lock whose "busy-ness" prevents the sensor from updating the registers.

If I understood correctly from reading the documentation two ways of implementing that is by using either a Transactional Device or a I2CCombinedMessage (MPU6050 only supports I2C access). The former is not an option on the RasPi platform which I am using, as the following code (mpu6050 is a I2CDevice instance):

if (mpu6050 instanceof Transactional) {

         System.out.println("Device transactional");

} else {

         System.out.println("Device not transactional");

}

prints: "Device not transactional"

I can implement that using the CombinedMessage approach but I was wondering..is there a semantic difference between the two approaches? i.e. if a Device supports the Transactional interface why would one choose one over the other?

Any input?

Thanks

Comments

The language shown in the Forms runtime is the result of your NLS_LANG setting in the runtime environment configuration (e.g. default.env). However, Forms can only change the language of labels it knows about. For example, the ones you highlighted. The column titles, in your example are labels that you elected to use (or column names from the DB). As a result, we cannot change them automatically because we would have no idea if that is what you wanted to do.

You would need to programmatically change those if desired. For example:

SET_LOV_COLUMN_PROPERTY ('LOV1', 2, TITLE, 'Nombre del empleado (Spanish)');

In this example, I am running a form in English but want one column to show in Spanish. So, I use the code above to make that change at runtime.

xu meng Feb 12 2025

Thanks for your reply, your example has inspired me a bit, but it still can't meet my usage needs.
I'm confused about:
When my system language variable is Chinese, I want to make the LOV component's Query/Confirm/Cancel button appear separately in other languages. As shown in the image above.
I don't know, but you can understand what I mean.

xu meng Feb 12 2025

As shown on the picture you provided. "查询" is displayed when the Chinese environment variable is used, and "FIND" is displayed when it is used in English. At present, I want to make the button of its LOV component window display "FIND" separately in the Chinese system, but I have not found the method in the help document and the network.

As I mentioned, strings built into Forms like “Find”, “Ok”, “Cancel”, and others can be translated into the language you choose in the runtime environment using the NLS_LANG settings. Unfortunately, this cannot be changed after the application has been started. So if the app is started with for example, Chinese-Traditional it cannot later be changed to French while the form is running. This means that you must either configure your server to support multiple languages and create modules for each language. This is often the best approach. There are other ways that customers have used, but what I described here likely would require the smallest effort.

You did not mention which Forms version you are using and therefore I cannot point you to the documentation for that version. However, here is the link to the related documentation for Forms 14.1.2. The concepts are basically the same for earlier versions, although some minor improvements have been introduced in the latest release (14.1.2).

https://docs.oracle.com/en/middleware/developer-tools/forms/14.1.2/working-forms/enabling-language-detection.html

But again, for strings that do not natively belong to Forms (you created them) you would need to programmatically change them as necessary.

xu meng Feb 12 2025

OH! I will try to implement your plan first. Thank you for your patience. My Forms version is 11.1.2.

As you are likely aware, but I feel it necessary to mention in case you are not, Forms 11.1.2 was desupported many years ago. I recommend you consider upgrading to the latest Supported version in order to ensure that you can get the latest bug fixes (including security fixes), the latest features, and improvements like what I mentioned about language support and others.

Details can always be found on the Forms product page.

https://www.oracle.com/application-development/technologies/forms/forms.html

xu meng Feb 12 2025

Thank you for telling me this news. I will consider your suggestion carefully and refer to it later. Thank you for your answer.

1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 27 2018
Added on Sep 6 2018
1 comment
511 views